/** * Retrieves all colour names defined in a rule * * @param rule the rule * @return an array of unique colour names */ public static String[] colors(Rule rule) { Set<String> colorSet = new HashSet<String>(); Color color = null; for (Symbolizer sym : rule.symbolizers()) { if (sym instanceof PolygonSymbolizer) { PolygonSymbolizer symb = (PolygonSymbolizer) sym; color = polyFill(symb); } else if (sym instanceof LineSymbolizer) { LineSymbolizer symb = (LineSymbolizer) sym; color = color(symb); } else if (sym instanceof PointSymbolizer) { PointSymbolizer symb = (PointSymbolizer) sym; color = color(symb); } if (color != null) { colorSet.add(color.toString()); } } if (colorSet.size() > 0) { return colorSet.toArray(new String[0]); } else { return new String[0]; } }
/** * A String representation of this {@code NamedColor} which contains a * representation of the {@code Color} and the names associated with it. * * @return */ @Override public String toString() { return super.toString() + names; }
/** * returns the name of the palette. * * @return */ public String getName() { return this.baseColor.toString(); }
/** * returns the name of the palette. * * @return */ public String getName() { return this.baseColor.toString(); }
LOGGER.fine("color " + c.toString());
@Override public void setColor(Color c) { g2d.setColor(c); trace("setColor: " + c.toString()); }
@Override public void setColor(Color c) { log.debug("Setcolor: " + c.toString()); }
@Override public void setColor(Color c) { g2d.setColor(c); trace("setColor: " + c.toString()); }
/** * java.awt.Color. Forward the call to the delegate. */ public String toString() { return getColor().toString(); }
/** * Returns the text Color of the activator text */ public String getTextColor() { Color color = getForeground(); return color.toString(); }
@Override public void setColor(Color c) { log.debug("Setcolor: " + c.toString()); }
private void mouseClicked(java.awt.event.MouseEvent evt) { JPanel panel = (JPanel)evt.getSource(); Color c = panel.getBackground(); System.out.println("color: " + c.toString()); }
@FXML private void onColorPickerButton() { Button[] buttons = {firstButton, secondButton, thirdButton}; Color color = colorPicker.getValue(); if(color!=null){ for (Button button : buttons) { button.setStyle("-fx-background-color: "+color.toString().replace("0x", "#")); } } }
@Override public String toString() { return String.format("At least %s percents of element does not have %s color", (100 - accuracy), color.toString() ); } };
@Override public void mouseClicked(final MouseEvent e) { log.info(label.getBackground().toString()); final Color color = JColorChooser.showDialog(label, "Choose color", label.getBackground()); mapProperties.getColorMap().put(label.getText(), color); createPlayerColorChooser(); validate(); repaint(); } });
private void createStyles() { for (Color color : owlEditorKit.getWorkspace().getKeyWordColorMap().values()) { Style style = getStyledDocument().addStyle(color.toString(), null); StyleConstants.setForeground(style, color); StyleConstants.setBold(style, true); } StyleConstants.setForeground(getStyledDocument().addStyle(Color.BLACK.toString(), null), Color.BLACK); }
private void createStyles() { for (Color color : owlEditorKit.getWorkspace().getKeyWordColorMap().values()) { Style style = getStyledDocument().addStyle(color.toString(), null); StyleConstants.setForeground(style, color); StyleConstants.setBold(style, true); } StyleConstants.setForeground(getStyledDocument().addStyle(Color.BLACK.toString(), null), Color.BLACK); }
private void createStyles() { for (Color color : owlEditorKit.getWorkspace().getKeyWordColorMap().values()) { Style style = getStyledDocument().addStyle(color.toString(), null); StyleConstants.setForeground(style, color); StyleConstants.setBold(style, true); } StyleConstants.setForeground(getStyledDocument().addStyle(Color.BLACK.toString(), null), Color.BLACK); }
private void createStyles() { for (Color color : owlEditorKit.getWorkspace().getKeyWordColorMap().values()) { Style style = getStyledDocument().addStyle(color.toString(), null); StyleConstants.setForeground(style, color); StyleConstants.setBold(style, true); } StyleConstants.setForeground(getStyledDocument().addStyle(Color.BLACK.toString(), null), Color.BLACK); }