javax.swing.colorchooser.ColorChooserComponentFactory Java Examples

The following examples show how to use javax.swing.colorchooser.ColorChooserComponentFactory. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: GraphColorChooser.java    From constellation with Apache License 2.0 5 votes vote down vote up
public GraphColorChooser() {
    // Add our named color panel by getting the existing panels and putting ours in front.
    final AbstractColorChooserPanel[] panels = ColorChooserComponentFactory.getDefaultChooserPanels();
    final AbstractColorChooserPanel[] morePanels = new AbstractColorChooserPanel[panels.length + 1];
    morePanels[0] = new NamedColorPanel();
    System.arraycopy(panels, 0, morePanels, 1, panels.length);

    setChooserPanels(morePanels);
}
 
Example #2
Source File: ColorChooserPane.java    From pentaho-reporting with GNU Lesser General Public License v2.1 5 votes vote down vote up
public ColorChooserPane() {
  colorModel = new ExtendedColorModel();
  colorModel.addChangeListener( new PreviewColorUpdater() );
  previewPane = ColorChooserComponentFactory.getPreviewPanel();
  multiSelectorPane = new JTabbedPane();
  swatchColorChooser = new SwatchColorChooser();

  addColorChooserPanel( new CombinedColorChooser() );
  addColorChooserPanel( swatchColorChooser );

  setLayout( new BorderLayout() );
  add( previewPane, BorderLayout.SOUTH );
  add( multiSelectorPane, BorderLayout.CENTER );
}