/// <summary> /// Show popups for each rectangle, using the now configured painter. /// </summary> private void showPopups(Rectangle[] rects, Rectangle bds, Rectangle visible, JComponent comp, JScrollPane view) { bool shown = false; for (int i = 0; i < rects.Length; i++) { Rectangle sect = rects[i]; sect.translate(-bds.x, -bds.y); ImgComp part = painter.getPartial(sect, bds.x + rects[i].x < visible.x); Point pos = new Point(bds.x + rects[i].x, bds.y + rects[i].y); SwingUtilities.convertPointToScreen(pos, comp); if (comp is JList) { //XXX off by one somewhere, only with JLists - where? pos.y--; } if (pos.x > 0) { //Mac OS will reposition off-screen popups to x=0, //so don't try to show them popups[i] = PopupFactory.getPopup(view, part, pos.x, pos.y); popups[i].show(); shown = true; } } if (shown) { setHideComponent(comp, view); } else { setHideComponent(null, null); //clear references } }
public StbiJpeg() { for (var i = 0; i < 4; ++i) { HuffAc[i] = new StbiHuffman(); HuffDc[i] = new StbiHuffman(); } for (var i = 0; i < ImgComp.Length; ++i) { ImgComp[i] = new ImgComp(); } FastAc = new short[4][]; for (var i = 0; i < FastAc.Length; ++i) { FastAc[i] = new short[1 << STBI_ZFAST_BITS]; } Dequant = new ushort[4][]; for (var i = 0; i < Dequant.Length; ++i) { Dequant[i] = new ushort[64]; } }