public void propertyChange(PropertyChangeEvent evt) { setEnabled ((Boolean) evt.getNewValue()); } });
public void itemsWereRemoved(ScrollablePopupMenuEvent ev) { updateMainButtonTooltip(ev.getDetails()); } });
(new ImageIcon (getClass().getResource(resources.getString("UndoButton.disabledIcon")))); DropDownComponent undoDD = new DropDownComponent(undoButton); undoDD.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 2)); undoDD.setMaximumSize(new Dimension(44, 25)); undoDD.setPreferredSize(new Dimension(44, 25)); tb.add(undoDD); UndoPopUpMenuModel undoModel = new UndoPopUpMenuModel(undoDD .getPopupMenu(), historyBrowserInterface); undoDD.getPopupMenu().setModel(undoModel); (new ImageIcon (getClass().getResource(resources.getString("RedoButton.disabledIcon")))); DropDownComponent redoDD = new DropDownComponent(redoButton); redoDD.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 2)); redoDD.setMaximumSize(new Dimension(44, 25)); redoDD.setPreferredSize(new Dimension(44, 25)); tb.add(redoDD); RedoPopUpMenuModel redoModel = new RedoPopUpMenuModel(redoDD .getPopupMenu(), historyBrowserInterface); redoDD.getPopupMenu().setModel(redoModel);
/** * Creates the dropdown menu with the given main button. * * @param mainButton * the components main button */ public DropDownComponent(JButton mainButton) { super(new BorderLayout()); // Initializes pop up menu popupMenu = getPopupMenu(); this.mainButton = mainButton; add(this.mainButton, BorderLayout.WEST); this.mainButton.setMaximumSize(new Dimension(24, 24)); this.mainButton.setPreferredSize(new Dimension(24, 24)); // Initializes dropdown button and icons for dropdown button enabledDownArrow = new SmallDownArrow(); disabledDownArrow = new SmallDisabledDownArrow(); dropDownButton = new JButton(disabledDownArrow); dropDownButton.setBorderPainted(false); dropDownButton.setDisabledIcon(disabledDownArrow); dropDownButton.addMouseListener(new DropDownListener()); dropDownButton.setMaximumSize(new Dimension(18, 24)); dropDownButton.setMinimumSize(new Dimension(18, 10)); dropDownButton.setPreferredSize(new Dimension(18, 10)); dropDownButton.setFocusPainted(false); add(dropDownButton, BorderLayout.EAST); setEnabled(false); }
(new ImageIcon (getClass().getResource(resources.getString("UndoButton.disabledIcon")))); DropDownComponent undoDD = new DropDownComponent(undoButton); undoDD.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 2)); undoDD.setMaximumSize(new Dimension(44, 25)); undoDD.setPreferredSize(new Dimension(44, 25)); tb.add(undoDD); UndoPopUpMenuModel undoModel = new UndoPopUpMenuModel(undoDD .getPopupMenu(), historyBrowserInterface); undoDD.getPopupMenu().setModel(undoModel); (new ImageIcon (getClass().getResource(resources.getString("RedoButton.disabledIcon")))); DropDownComponent redoDD = new DropDownComponent(redoButton); redoDD.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 2)); redoDD.setMaximumSize(new Dimension(44, 25)); redoDD.setPreferredSize(new Dimension(44, 25)); tb.add(redoDD); RedoPopUpMenuModel redoModel = new RedoPopUpMenuModel(redoDD .getPopupMenu(), historyBrowserInterface); redoDD.getPopupMenu().setModel(redoModel);
/** * Creates the dropdown menu with the given main button. * * @param mainButton * the components main button */ public DropDownComponent(JButton mainButton) { super(new BorderLayout()); // Initializes pop up menu popupMenu = getPopupMenu(); this.mainButton = mainButton; add(this.mainButton, BorderLayout.WEST); this.mainButton.setMaximumSize(new Dimension(24, 24)); this.mainButton.setPreferredSize(new Dimension(24, 24)); // Initializes dropdown button and icons for dropdown button enabledDownArrow = new SmallDownArrow(); disabledDownArrow = new SmallDisabledDownArrow(); dropDownButton = new JButton(disabledDownArrow); dropDownButton.setBorderPainted(false); dropDownButton.setDisabledIcon(disabledDownArrow); dropDownButton.addMouseListener(new DropDownListener()); dropDownButton.setMaximumSize(new Dimension(18, 24)); dropDownButton.setMinimumSize(new Dimension(18, 10)); dropDownButton.setPreferredSize(new Dimension(18, 10)); dropDownButton.setFocusPainted(false); add(dropDownButton, BorderLayout.EAST); setEnabled(false); }
public void itemsWereRemoved(ScrollablePopupMenuEvent ev) { updateMainButtonTooltip(ev.getDetails()); } });
public void propertyChange(PropertyChangeEvent evt) { setEnabled (((Boolean) evt.getNewValue()).booleanValue()); } });
public void itemsWereAdded(ScrollablePopupMenuEvent ev) { updateMainButtonTooltip(ev.getDetails()); }
public void itemsWereAdded(ScrollablePopupMenuEvent ev) { updateMainButtonTooltip(ev.getDetails()); }