/** * Gets the custom panel used for editing the object. * * @return the panel */ @Override public JPanel getCustomPanel() { final JButton chooseButton = createChooseClassButton(); m_ObjectPropertyPanel = new PropertyPanel(this, true); JPanel customPanel = new JPanel() { /** ID added to avoid warning */ private static final long serialVersionUID = 1024049543672124980L; @Override public void setEnabled(boolean enabled) { super.setEnabled(enabled); chooseButton.setEnabled(enabled); } }; customPanel.setLayout(new BorderLayout()); customPanel.add(chooseButton, BorderLayout.WEST); customPanel.add(m_ObjectPropertyPanel, BorderLayout.CENTER); return customPanel; }
/** * Create the panel with the supplied property editor, optionally ignoring any * custom panel the editor can provide. * * @param pe the PropertyEditor * @param ignoreCustomPanel whether to make use of any available custom panel */ public PropertyPanel(PropertyEditor pe, boolean ignoreCustomPanel) { m_Editor = pe; if (!ignoreCustomPanel && m_Editor instanceof CustomPanelSupplier) { setLayout(new BorderLayout()); m_CustomPanel = ((CustomPanelSupplier) m_Editor).getCustomPanel(); add(m_CustomPanel, BorderLayout.CENTER); m_HasCustomPanel = true; } else { createDefaultPanel(); } }
setBorder(BorderFactory.createEtchedBorder()); setToolTipText("Left-click to edit properties for this object, right-click/Alt+Shift+left-click for menu"); setOpaque(true); final Component comp = this; addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent evt) { Dimension newPref = getPreferredSize(); newPref.height = getFontMetrics(getFont()).getHeight() * 5 / 4; newPref.width = newPref.height * 5; setPreferredSize(newPref);
/** * Paints the component, using the property editor's paint method. * * @param g the current graphics context */ @Override public void paintComponent(Graphics g) { if (!m_HasCustomPanel) { Insets i = getInsets(); Rectangle box = new Rectangle(i.left, i.top, getSize().width - i.left - i.right - 1, getSize().height - i.top - i.bottom - 1); g.clearRect(i.left, i.top, getSize().width - i.right - i.left, getSize().height - i.bottom - i.top); m_Editor.paintValue(g, box); } }
m_ResultMatrixPanel = new PropertyPanel(m_ResultMatrixEditor, false); m_ResultMatrixLabel = new JLabel("Advanced setup"); panel2 = new JPanel(new FlowLayout(FlowLayout.LEFT)); m_ResultMatrixLabel.setPreferredSize(new Dimension(m_RemoveFilterNameLabel .getWidth(), m_ResultMatrixLabel.getHeight())); m_ResultMatrixPanel.setPreferredSize(new Dimension( (int) (m_ResultMatrixPanel.getWidth() * 1.5), m_ResultMatrixPanel .getHeight()));
/** * Adds the current editor value to the history. * * @return true if successfully added (i.e., if editor is a GOE) */ public boolean addToHistory() { return addToHistory(m_Editor.getValue()); }
m_ClassificationOutputPanel.setPreferredSize(new Dimension(300, m_ClassificationOutputPanel.getHeight())); jd.pack();
m_ResultMatrixPanel = new PropertyPanel(m_ResultMatrixEditor, false); m_ResultMatrixLabel = new JLabel("Advanced setup"); panel2 = new JPanel(new FlowLayout(FlowLayout.LEFT)); m_ResultMatrixLabel.setPreferredSize(new Dimension(m_RemoveFilterNameLabel .getWidth(), m_ResultMatrixLabel.getHeight())); m_ResultMatrixPanel.setPreferredSize(new Dimension( (int) (m_ResultMatrixPanel.getWidth() * 1.5), m_ResultMatrixPanel .getHeight()));
/** * Adds the current editor value to the history. * * @return true if successfully added (i.e., if editor is a GOE) */ public boolean addToHistory() { return addToHistory(m_Editor.getValue()); }
/** * Paints the component, using the property editor's paint method. * * @param g the current graphics context */ @Override public void paintComponent(Graphics g) { if (!m_HasCustomPanel) { Insets i = getInsets(); Rectangle box = new Rectangle(i.left, i.top, getSize().width - i.left - i.right - 1, getSize().height - i.top - i.bottom - 1); g.clearRect(i.left, i.top, getSize().width - i.right - i.left, getSize().height - i.bottom - i.top); m_Editor.paintValue(g, box); } }
m_ClassificationOutputPanel.setPreferredSize(new Dimension(300, m_ClassificationOutputPanel.getHeight())); jd.pack();
setBorder(BorderFactory.createEtchedBorder()); setToolTipText("Left-click to edit properties for this object, right-click/Alt+Shift+left-click for menu"); setOpaque(true); final Component comp = this; addMouseListener(new MouseAdapter() { @Override public void mouseClicked(MouseEvent evt) { Dimension newPref = getPreferredSize(); newPref.height = getFontMetrics(getFont()).getHeight() * 5 / 4; newPref.width = newPref.height * 5; setPreferredSize(newPref);
/** * Gets the custom panel used for editing the object. * * @return the panel */ @Override public JPanel getCustomPanel() { final JButton chooseButton = createChooseClassButton(); m_ObjectPropertyPanel = new PropertyPanel(this, true); JPanel customPanel = new JPanel() { /** ID added to avoid warning */ private static final long serialVersionUID = 1024049543672124980L; @Override public void setEnabled(boolean enabled) { super.setEnabled(enabled); chooseButton.setEnabled(enabled); } }; customPanel.setLayout(new BorderLayout()); customPanel.add(chooseButton, BorderLayout.WEST); customPanel.add(m_ObjectPropertyPanel, BorderLayout.CENTER); return customPanel; }
/** * Create the panel with the supplied property editor, optionally ignoring any * custom panel the editor can provide. * * @param pe the PropertyEditor * @param ignoreCustomPanel whether to make use of any available custom panel */ public PropertyPanel(PropertyEditor pe, boolean ignoreCustomPanel) { m_Editor = pe; if (!ignoreCustomPanel && m_Editor instanceof CustomPanelSupplier) { setLayout(new BorderLayout()); m_CustomPanel = ((CustomPanelSupplier) m_Editor).getCustomPanel(); add(m_CustomPanel, BorderLayout.CENTER); m_HasCustomPanel = true; } else { createDefaultPanel(); } }
@Override public void run() { m_CEPanel.addToHistory();
/** * creates the panel */ public DataGeneratorPanel() { setLayout(new BorderLayout()); add(new PropertyPanel(m_GeneratorEditor), BorderLayout.CENTER); // editor m_GeneratorEditor.setClassType(DataGenerator.class); m_GeneratorEditor.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { repaint(); } }); // set default generator setGenerator(null); }
@Override public void run() { m_CEPanel.addToHistory();
/** * creates the panel */ public DataGeneratorPanel() { setLayout(new BorderLayout()); add(new PropertyPanel(m_GeneratorEditor), BorderLayout.CENTER); // editor m_GeneratorEditor.setClassType(DataGenerator.class); m_GeneratorEditor.addPropertyChangeListener(new PropertyChangeListener() { public void propertyChange(PropertyChangeEvent e) { repaint(); } }); // set default generator setGenerator(null); }
m_FilterPanel.addToHistory();
view = new PropertyPanel(editor); lcr = new EditorListCellRenderer(editor.getClass(), elementClass); } else if (editor.getTags() != null) {