private void setSelected(ToolButton button) { if (fSelectedToolButton != null) { fSelectedToolButton.reset(); } fSelectedToolButton = button; if (fSelectedToolButton != null) { fSelectedToolButton.select(); } }
/** * Handles when the mouse enters or leaves a palette button. * * @see PaletteListener */ public void paletteUserOver(PaletteButton button, boolean inside) { if (inside) { showStatus(((ToolButton) button).name()); } else { showStatus(fSelectedToolButton.name()); } }
/** * Sets the default tool of the editor. * * @see DrawingEditor */ public void toolDone() { setTool(fDefaultToolButton.tool(), fDefaultToolButton.name()); setSelected(fDefaultToolButton); }
/** * Handles a user selection in the palette. * * @see PaletteListener */ public void paletteUserSelected(PaletteButton button) { ToolButton toolButton = (ToolButton) button; setTool(toolButton.tool(), toolButton.name()); setSelected(toolButton); }