public MenuScrollItem(MenuIcon icon, int increment) { setIcon(icon); setDisabledIcon(icon); timer = new MenuScrollTimer(increment, interval); addChangeListener(this); }
/** * Each KeyCommand has a built-in default; if now key binding file can be * found, we should register those defaults. * * @param controller */ public static void registerDefaultKeyBinds(MegaMekController controller) { for (KeyCommandBind kcb : KeyCommandBind.values()) { controller.registerKeyCommandBind(kcb); } }
public static int getAdvColorRGB(int colorIndex, int plrIndex) { if (colorIndex > advancedColorRGBs.length) { return getColorRGB(plrIndex); } return advancedColorRGBs[colorIndex]; }
protected boolean parse() { boolean hasErrors = false; nextToken(); try { parseColor(); } catch (ParseException e) { hasErrors = true; exception = e; } return hasErrors; }
/** * Registers a menu to be scrolled with the default number of items to * display at a time and the default scrolling interval. * * @param menu the menu * @return the MenuScroller */ public static MenuScroller setScrollerFor(JMenu menu) { return new MenuScroller(menu); }
@Override public void setPixels(int x, int y, int width, int height, ColorModel cm, byte pixels[], int offset, int scansize) { setThePixels(x, y, width, height, cm, pixels, offset, scansize); }
/** * Ensures that the <code>dispose</code> method of this MenuScroller is * called when there are no more refrences to it. * * @exception Throwable if an error occurs. * @see MenuScroller#dispose() */ @Override public void finalize() throws Throwable { dispose(); }
/** * Return true if the point is inside our polygon */ @Override public boolean isInside(Point point) { return attackPoly.contains(point.x - bounds.x, point.y - bounds.y); }
/** * Write the imgFile to Atlas map to a file. */ public void writeImgFileToAtlasMap() { imgFileToAtlasMap.writeToFile(); }
/** * Rotate all pixels. */ private void rotate() { int[] newpixels = new int[width * height]; for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { newpixels[y * width + x] = rotatedPixel(x, y); } } raster = newpixels; }
/** * Returns the "destination image" pixel */ private final int rotatedPixel(int x, int y) { double tx = -(cx - x); double ty = -(cy - y); double rx = cos * tx - sin * ty; double ry = cos * ty + sin * tx; return pixelBilinear(rx + cx, ry + cy); }
public synchronized void reset() { basesCache = new ImageCache<IHex, Image>(); supersCache = new ImageCache<IHex, List<Image>>(); orthosCache = new ImageCache<IHex, List<Image>>(); }
/** * Registers a popup menu to be scrolled with the default number of items to * display at a time and the default scrolling interval. * * @param menu the popup menu * @return the MenuScroller */ public static MenuScroller setScrollerFor(JPopupMenu menu) { return new MenuScroller(menu); }
@Override public void setPixels(int x, int y, int width, int height, ColorModel cm, int pixels[], int offset, int scansize) { setThePixels(x, y, width, height, cm, pixels, offset, scansize); }
/** * Registers a popup menu to be scrolled with the default number of items to * display at a time and the specified scrolling interval. * * @param menu the popup menu * @param scrollCount the number of items to display at a time * @return the MenuScroller * @throws IllegalArgumentException if scrollCount is 0 or negative */ public static MenuScroller setScrollerFor(JPopupMenu menu, int scrollCount) { return new MenuScroller(menu, scrollCount); }