private void paintArrow(Component c, Graphics g, int x, int y) { if (!m_partArrow.isVisible()) { return; } int arrowHeight = 3; int maxArrowWidth = 5; int startAtX = x + getIconWidth() - maxArrowWidth; int startAtY = y + 2; g.setColor(ARROW_COLOR_MAP.get(m_partArrow.getIconState())); for (int j = 0; j < arrowHeight; j++) { int arrowWidth = calcArrowWidth(j); int ax = startAtX + j; int ay = startAtY + j; g.drawLine(ax, ay, ax + arrowWidth - 1, ay); } }
public void setMouseOver(MouseOver mouseOver) { if (MouseOver.NONE == mouseOver) { m_partIcon.setMouseOver(false); m_partArrow.setMouseOver(false); } else if (MouseOver.ICON == mouseOver) { m_partIcon.setMouseOver(true); m_partArrow.setMouseOver(false); } else if (MouseOver.ARROW == mouseOver) { m_partIcon.setMouseOver(false); m_partArrow.setMouseOver(true); } }
private Icon getIconForState() { return m_iconGroup.getIcon(m_partIcon.getIconState()); }
public void setIconEnabled(boolean enabled) { m_partIcon.setEnabled(enabled); }
public boolean isIconEnabled() { return m_partIcon.isEnabled(); }
public void setArrowEnabled(boolean enabled) { m_partArrow.setEnabled(enabled); m_partArrow.setVisible(enabled); }
public boolean isArrowEnabled() { return m_partArrow.isEnabled(); }
public DropDownButtonIcon(ISwingEnvironment env) { m_env = env; m_partArrow.setEnabled(false); m_partArrow.setVisible(false); m_iconGroup = new IconGroup(m_env, AbstractIcons.SmartFieldBrowse); }