private Color createColor(String colorAsHexString) { int[] rgba = ColorHelper.fromHexString(colorAsHexString); return new Color(rgba[0], rgba[1], rgba[2], rgba[3]); }
static Color createColor(String colorAsHexString) { if (ColorHelper.isColorSpec(colorAsHexString)) { int[] rgba = ColorHelper.fromHexString(colorAsHexString); return new Color(rgba[0], rgba[1], rgba[2], rgba[3]); } return null; }
private void handleSetValue(Anything args) { String hexColor = args.get(ColorPickerConstants.VALUE_KEY, ""); Color newValue = null; if (hexColor.length() > 0) { int[] rgba = ColorHelper.fromHexString(hexColor); newValue = new Color(rgba[0], rgba[1], rgba[2], rgba[3]); } this.value = newValue; }
private void handleSetValue(Anything args) { String hexColor = args.get(ColorPickerConstants.VALUE_KEY, ""); Color newValue = null; if (hexColor.length() > 0) { int[] rgba = ColorHelper.fromHexString(hexColor); newValue = new Color(rgba[0], rgba[1], rgba[2], rgba[3]); } this.value = newValue; }
/** * {@inheritDoc} */ @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { if (value != null) { int[] rgba = ColorHelper.fromHexString((String) value); setBackground(new Color(rgba[0], rgba[1], rgba[2], rgba[3])); } else { setBackground(null); } return super.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column); } }
private void handleSetValue(Anything args) { String hexColor = args.get(ColorPickerConstants.VALUE_KEY, ""); Color value = null; if (hexColor.length() > 0) { int[] rgba = ColorHelper.fromHexString(hexColor); value = new Color(rgba[0], rgba[1], rgba[2], rgba[3]); } getBasicObject().setValue(value); }
private void handleResetValue(Anything args) { String hexColor = args.get(ColorPickerConstants.RESETVALUE_KEY, ""); Color resetValue = null; if (hexColor.length() > 0) { int[] rgba = ColorHelper.fromHexString(hexColor); resetValue = new Color(rgba[0], rgba[1], rgba[2], rgba[3]); } getBasicObject().setResetValue(resetValue); }
private void handleResetValue(Anything args) { String hexColor = args.get(ColorPickerConstants.RESETVALUE_KEY, ""); Color resetValue = null; if (hexColor.length() > 0) { int[] rgba = ColorHelper.fromHexString(hexColor); resetValue = new Color(rgba[0], rgba[1], rgba[2], rgba[3]); } getBasicObject().setResetValue(resetValue); }
private void handleSetResetValue(Anything args) { String hexColor = args.get(ColorPickerConstants.RESETVALUE_KEY, ""); Color resetValue = null; if (hexColor.length() > 0) { int[] rgba = ColorHelper.fromHexString(hexColor); resetValue = new Color(rgba[0], rgba[1], rgba[2], rgba[3]); } getBasicObject().setResetValue(resetValue); }
private void handleSetValue(Anything args) { String hexColor = args.get(ColorPickerConstants.VALUE_KEY, ""); Color value = null; if (hexColor.length() > 0) { int[] rgba = ColorHelper.fromHexString(hexColor); value = new Color(rgba[0], rgba[1], rgba[2], rgba[3]); } getBasicObject().setValue(value); }
private void handleSetResetValue(Anything args) { String hexColor = args.get(ColorPickerConstants.RESETVALUE_KEY, ""); Color resetValue = null; if (hexColor.length() > 0) { int[] rgba = ColorHelper.fromHexString(hexColor); resetValue = new Color(rgba[0], rgba[1], rgba[2], rgba[3]); } getBasicObject().setResetValue(resetValue); }
/** * {@inheritDoc} */ @Override protected void protectedSetConnecteeValue(Object aValue) { if (aValue != null) { int[] rgba = ColorHelper.fromHexString((String) aValue); getConnectedJComponent().setValue( new Color(rgba[0], rgba[1], rgba[2], rgba[3])); } else { getConnectedJComponent().setValue(null); } }
/** * {@inheritDoc} */ @Override protected void protectedSetConnecteeValue(Object aValue) { if (aValue != null) { int[] rgba = ColorHelper.fromHexString((String) aValue); getConnectedJComponent().setValue( new Color(rgba[0], rgba[1], rgba[2], rgba[3])); } else { getConnectedJComponent().setValue(null); } }
/** * {@inheritDoc} */ @Override protected void setConnecteeValue(Object aValue) { if (aValue != null) { int[] rgba = ColorHelper.fromHexString((String) aValue); getConnectedSComponent().setValue( new Color(rgba[0], rgba[1], rgba[2], rgba[3])); } else { getConnectedSComponent().setValue(null); } } }
/** * {@inheritDoc} */ @Override protected void setConnecteeValue(Object aValue) { if (aValue != null) { int[] rgba = ColorHelper.fromHexString((String) aValue); getConnectedSComponent().setValue( new Color(rgba[0], rgba[1], rgba[2], rgba[3])); } else { getConnectedSComponent().setValue(null); } } }
/** * {@inheritDoc} */ @SuppressWarnings("unused") public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int col) { getBasicObject().removeChangeListener(editingStopChangeListener); int[] rgba = ColorHelper.fromHexString((String) value); getBasicObject().setValue(new Color(rgba[0], rgba[1], rgba[2], rgba[3])); getBasicObject().addChangeListener(editingStopChangeListener); return getBasicObject(); }
/** * {@inheritDoc} */ @SuppressWarnings("unused") public Component getTableCellEditorComponent(JTable table, Object value, boolean isSelected, int row, int col) { getBasicObject().removeChangeListener(editingStopChangeListener); int[] rgba = ColorHelper.fromHexString((String) value); getBasicObject().setValue(new Color(rgba[0], rgba[1], rgba[2], rgba[3])); getBasicObject().addChangeListener(editingStopChangeListener); return getBasicObject(); }
/** * Set the state of the date field depending on the connector value to set. * <p> * {@inheritDoc} */ @Override protected void setConnecteeValue(Object aValue) { if (aValue != null) { int[] rgba = ColorHelper.fromHexString((String) aValue); getConnectedULCComponent().setValue( new Color(rgba[0], rgba[1], rgba[2], rgba[3])); } else { getConnectedULCComponent().setValue(null); } }
private IView<SComponent> createColorPropertyView( IColorPropertyDescriptor propertyDescriptor, IActionHandler actionHandler, @SuppressWarnings("unused") Locale locale) { SColorPicker viewComponent = createSColorPicker(); if (propertyDescriptor.getDefaultValue() != null) { int[] rgba = ColorHelper.fromHexString((String) propertyDescriptor .getDefaultValue()); viewComponent .setResetValue(new Color(rgba[0], rgba[1], rgba[2], rgba[3])); } SColorPickerConnector connector = new SColorPickerConnector( propertyDescriptor.getName(), viewComponent); connector.setExceptionHandler(actionHandler); return constructView(viewComponent, null, connector); }
private IView<ULCComponent> createColorPropertyView( IColorPropertyDescriptor propertyDescriptor, IActionHandler actionHandler, @SuppressWarnings("unused") Locale locale) { ULCColorPicker viewComponent = createULCColorPicker(); if (propertyDescriptor.getDefaultValue() != null) { int[] rgba = ColorHelper.fromHexString((String) propertyDescriptor .getDefaultValue()); viewComponent .setResetValue(new Color(rgba[0], rgba[1], rgba[2], rgba[3])); } ULCColorPickerConnector connector = new ULCColorPickerConnector( propertyDescriptor.getName(), viewComponent); connector.setExceptionHandler(actionHandler); return constructView(viewComponent, null, connector); }