@Override protected void initUIChild() { _colorDisplay = new ColorDisplay(); nameComponent(_colorDisplay, "ColorDisplay"); }
/** * Gets the UI component used to edit the parameter's value. */ public JComponent getEditorComponent() { return getCheckBox(); }
/** * Gets the UI component used to edit the parameter's value. */ public JComponent getEditorComponent() { return getRadioButton(); }
@Override public void updateUI() { super.updateUI(); if (getColorDisplay().isEnabled() != isEnabled()) { getColorDisplay().setEnabled(isEnabled()); } getColorDisplay().repaint(); }
@Override protected void invokeXEditor() { Color color = JColorChooser.showDialog(getEditorComponent(), "Select Colour", /*I18N*/ getParameterColorValue()); if (color != null) { setParameterColorValue(color); } }
private P getSelectedProduct(final ParamProperties paramProperties) throws IOException { final Object propertyValue = paramProperties.getPropertyValue(PROPERTY_KEY_SELECTED_PRODUCT); if (propertyValue == null) { return null; } if (propertyValue instanceof Product) { return new P((Product) propertyValue, false); } else if (propertyValue instanceof String) { return new P(openProduct((String) propertyValue), true); } else { throw new IllegalStateException( "parameter property '" + PROPERTY_KEY_SELECTED_PRODUCT + "' has an illegal type"); } }
private void setParameterFileValue(File file) { getParameter().setValue(file, null); updateLastDir(); }
private Color getParameterColorValue() { Color color = (Color) getParameter().getValue(); return color == null ? Color.black : color; }
private String getParameterExprValue() { return (String) getParameter().getValue(); }
/** * Gets the UI component used to edit the parameter's value. */ public JComponent getEditorComponent() { return getComboBox(); }
/** * Gets the UI component used to edit the parameter's value. */ public JComponent getEditorComponent() { return getLabel(); }
/** * Gets the UI component used to edit the parameter's value. */ public JComponent getEditorComponent() { return getTextComponent(); }
/** * Gets the UI component used to edit the parameter's value. */ public JComponent getEditorComponent() { return getListScrollPane(); }
public FileEditor(Parameter parameter) { super(parameter); updateLastDir(); }
@Override public JComponent getEditorComponentChild() { return getColorDisplay(); }
public ColorDisplay() { setBorder(BorderFactory.createCompoundBorder(BorderFactory.createEmptyBorder(0, 0, 1, 1), BorderFactory.createLineBorder(Color.darkGray))); }
private ParamProperties getParamProps() { return getParameter().getProperties(); }
private File getParameterFileValue() { return (File) getParameter().getValue(); }
private void setParameterColorValue(Color color) { getParameter().setValue(color, null); }
private void setParameterExprValue(final String value) { getParameter().setValue(value, null); }