public class ButtonFactory
extends java.lang.Object
Design pattern:
Name: Abstract Factory.
Role: Abstract Factory.
Partners: DrawApplicationModel
as Client,
DrawView
as Client,
DrawingPanel
as Client.
FIXME - All buttons created using the ButtonFactory must automatically
become disabled/enabled, when the DrawingEditor is disabled/enabled.
Modifier and Type | Field and Description |
---|---|
static java.util.List<ColorIcon> |
DEFAULT_COLORS
Mac OS X 'Apple Color Palette'.
|
static int |
DEFAULT_COLORS_COLUMN_COUNT |
static java.util.List<ColorIcon> |
HSB_COLORS
HSB color palette with a set of colors chosen based on a physical criteria.
|
static java.util.List<ColorIcon> |
HSB_COLORS_AS_RGB
This is the same palette as HSB_COLORS, but all color values are
specified in the sRGB color space.
|
static int |
HSB_COLORS_AS_RGB_COLUMN_COUNT |
static int |
HSB_COLORS_COLUMN_COUNT |
static java.util.List<ColorIcon> |
WEBSAVE_COLORS
Websave color palette as used by Macromedia Fireworks.
|
static int |
WEBSAVE_COLORS_COLUMN_COUNT |
Modifier and Type | Method and Description |
---|---|
static void |
addAlignmentButtonsTo(javax.swing.JToolBar bar,
DrawingEditor editor)
Creates toolbar buttons and adds them to the specified JToolBar
|
static void |
addAlignmentButtonsTo(javax.swing.JToolBar bar,
DrawingEditor editor,
java.util.List<Disposable> dsp)
Creates toolbar buttons and adds them to the specified JToolBar.
|
static void |
addAttributesButtonsTo(javax.swing.JToolBar bar,
DrawingEditor editor)
Creates toolbar buttons and adds them to the specified JToolBar
|
static void |
addColorButtonsTo(javax.swing.JToolBar bar,
DrawingEditor editor) |
static void |
addColorButtonsTo(javax.swing.JToolBar bar,
DrawingEditor editor,
java.util.List<ColorIcon> colors,
int columnCount) |
static void |
addFontButtonsTo(javax.swing.JToolBar bar,
DrawingEditor editor) |
static javax.swing.JToggleButton |
addSelectionToolTo(javax.swing.JToolBar tb,
DrawingEditor editor) |
static javax.swing.JToggleButton |
addSelectionToolTo(javax.swing.JToolBar tb,
DrawingEditor editor,
java.util.Collection<javax.swing.Action> drawingActions,
java.util.Collection<javax.swing.Action> selectionActions) |
static javax.swing.JToggleButton |
addSelectionToolTo(javax.swing.JToolBar tb,
DrawingEditor editor,
Tool selectionTool) |
static void |
addStrokeButtonsTo(javax.swing.JToolBar bar,
DrawingEditor editor) |
static javax.swing.JToggleButton |
addToolTo(javax.swing.JToolBar tb,
DrawingEditor editor,
Tool tool,
java.lang.String labelKey,
ResourceBundleUtil labels)
Method addSelectionToolTo must have been invoked prior to this on the
JToolBar.
|
static void |
addZoomButtonsTo(javax.swing.JToolBar bar,
DrawingEditor editor) |
static javax.swing.JButton |
createApplyAttributesButton(DrawingEditor editor)
Creates a button that applies the default attributes of the editor to
the current selection.
|
static javax.swing.JButton |
createApplyAttributesButton(DrawingEditor editor,
java.util.List<Disposable> dsp) |
static java.util.Collection<javax.swing.Action> |
createDrawingActions(DrawingEditor editor) |
static java.util.Collection<javax.swing.Action> |
createDrawingActions(DrawingEditor editor,
java.util.List<Disposable> dsp) |
static JPopupButton |
createDrawingColorButton(DrawingEditor editor,
AttributeKey<java.awt.Color> attributeKey,
java.util.List<ColorIcon> swatches,
int columnCount,
java.lang.String labelKey,
ResourceBundleUtil labels)
Creates a color button, with an action region and a popup menu.
|
static JPopupButton |
createDrawingColorButton(DrawingEditor editor,
AttributeKey<java.awt.Color> attributeKey,
java.util.List<ColorIcon> swatches,
int columnCount,
java.lang.String labelKey,
ResourceBundleUtil labels,
java.util.Map<AttributeKey,java.lang.Object> defaultAttributes)
Creates a color button, with an action region and a popup menu.
|
static JPopupButton |
createDrawingColorButton(DrawingEditor editor,
AttributeKey<java.awt.Color> attributeKey,
java.util.List<ColorIcon> swatches,
int columnCount,
java.lang.String labelKey,
ResourceBundleUtil labels,
java.util.Map<AttributeKey,java.lang.Object> defaultAttributes,
java.awt.Shape colorShape)
Creates a color button, with an action region and a popup menu.
|
static JPopupButton |
createDrawingColorButton(DrawingEditor editor,
AttributeKey<java.awt.Color> attributeKey,
java.util.List<ColorIcon> swatches,
int columnCount,
java.lang.String labelKey,
ResourceBundleUtil labels,
java.util.Map<AttributeKey,java.lang.Object> defaultAttributes,
java.awt.Shape colorShape,
java.util.List<Disposable> dsp)
Creates a color button, with an action region and a popup menu.
|
static JPopupButton |
createDrawingColorChooserButton(DrawingEditor editor,
AttributeKey<java.awt.Color> attributeKey,
java.lang.String labelKey,
ResourceBundleUtil labels,
java.util.Map<AttributeKey,java.lang.Object> defaultAttributes,
java.awt.Shape colorShape,
java.lang.Class uiclass,
java.util.List<Disposable> dsp) |
static JPopupButton |
createDrawingColorChooserButton(DrawingEditor editor,
AttributeKey<java.awt.Color> attributeKey,
java.lang.String labelKey,
ResourceBundleUtil labels,
java.util.Map<AttributeKey,java.lang.Object> defaultAttributes,
java.awt.Shape colorShape,
java.util.List<Disposable> dsp) |
static JPopupButton |
createEditorColorButton(DrawingEditor editor,
AttributeKey<java.awt.Color> attributeKey,
java.util.List<ColorIcon> swatches,
int columnCount,
java.lang.String labelKey,
ResourceBundleUtil labels)
Creates a color button, with an action region and a popup menu.
|
static JPopupButton |
createEditorColorButton(DrawingEditor editor,
AttributeKey<java.awt.Color> attributeKey,
java.util.List<ColorIcon> swatches,
int columnCount,
java.lang.String labelKey,
ResourceBundleUtil labels,
java.util.Map<AttributeKey,java.lang.Object> defaultAttributes)
Creates a color button, with an action region and a popup menu.
|
static JPopupButton |
createEditorColorButton(DrawingEditor editor,
AttributeKey<java.awt.Color> attributeKey,
java.util.List<ColorIcon> swatches,
int columnCount,
java.lang.String labelKey,
ResourceBundleUtil labels,
java.util.Map<AttributeKey,java.lang.Object> defaultAttributes,
java.awt.Shape colorShape)
Creates a color button, with an action region and a popup menu.
|
static JPopupButton |
createFontButton(DrawingEditor editor) |
static JPopupButton |
createFontButton(DrawingEditor editor,
AttributeKey<java.awt.Font> key,
ResourceBundleUtil labels) |
static JPopupButton |
createFontButton(DrawingEditor editor,
AttributeKey<java.awt.Font> key,
ResourceBundleUtil labels,
java.util.List<Disposable> dsp) |
static JPopupButton |
createFontButton(DrawingEditor editor,
ResourceBundleUtil labels) |
static javax.swing.JButton |
createFontStyleBoldButton(DrawingEditor editor) |
static javax.swing.JButton |
createFontStyleBoldButton(DrawingEditor editor,
ResourceBundleUtil labels) |
static javax.swing.JButton |
createFontStyleBoldButton(DrawingEditor editor,
ResourceBundleUtil labels,
java.util.List<Disposable> dsp) |
static javax.swing.JButton |
createFontStyleItalicButton(DrawingEditor editor) |
static javax.swing.JButton |
createFontStyleItalicButton(DrawingEditor editor,
ResourceBundleUtil labels) |
static javax.swing.JButton |
createFontStyleItalicButton(DrawingEditor editor,
ResourceBundleUtil labels,
java.util.List<Disposable> dsp) |
static javax.swing.JButton |
createFontStyleUnderlineButton(DrawingEditor editor) |
static javax.swing.JButton |
createFontStyleUnderlineButton(DrawingEditor editor,
ResourceBundleUtil labels) |
static javax.swing.JButton |
createFontStyleUnderlineButton(DrawingEditor editor,
ResourceBundleUtil labels,
java.util.List<Disposable> dsp) |
static javax.swing.JButton |
createPickAttributesButton(DrawingEditor editor) |
static javax.swing.JButton |
createPickAttributesButton(DrawingEditor editor,
java.util.List<Disposable> dsp) |
static java.util.Collection<javax.swing.Action> |
createSelectionActions(DrawingEditor editor) |
static JPopupButton |
createSelectionColorButton(DrawingEditor editor,
AttributeKey<java.awt.Color> attributeKey,
java.util.List<ColorIcon> swatches,
int columnCount,
java.lang.String labelKey,
ResourceBundleUtil labels)
Creates a color button, with an action region and a popup menu.
|
static JPopupButton |
createSelectionColorButton(DrawingEditor editor,
AttributeKey<java.awt.Color> attributeKey,
java.util.List<ColorIcon> swatches,
int columnCount,
java.lang.String labelKey,
ResourceBundleUtil labels,
java.util.Map<AttributeKey,java.lang.Object> defaultAttributes)
Creates a color button, with an action region and a popup menu.
|
static JPopupButton |
createSelectionColorButton(DrawingEditor editor,
AttributeKey<java.awt.Color> attributeKey,
java.util.List<ColorIcon> swatches,
int columnCount,
java.lang.String labelKey,
ResourceBundleUtil labels,
java.util.Map<AttributeKey,java.lang.Object> defaultAttributes,
java.awt.Shape colorShape)
Creates a color button, with an action region and a popup menu.
|
static JPopupButton |
createSelectionColorButton(DrawingEditor editor,
AttributeKey<java.awt.Color> attributeKey,
java.util.List<ColorIcon> swatches,
int columnCount,
java.lang.String labelKey,
ResourceBundleUtil labels,
java.util.Map<AttributeKey,java.lang.Object> defaultAttributes,
java.awt.Shape colorShape,
java.util.List<Disposable> dsp)
Creates a color button, with an action region and a popup menu.
|
static JPopupButton |
createSelectionColorChooserButton(DrawingEditor editor,
AttributeKey<java.awt.Color> attributeKey,
java.lang.String labelKey,
ResourceBundleUtil labels,
java.util.Map<AttributeKey,java.lang.Object> defaultAttributes,
java.awt.Shape colorShape,
java.lang.Class uiclass,
java.util.List<Disposable> dsp) |
static JPopupButton |
createSelectionColorChooserButton(DrawingEditor editor,
AttributeKey<java.awt.Color> attributeKey,
java.lang.String labelKey,
ResourceBundleUtil labels,
java.util.Map<AttributeKey,java.lang.Object> defaultAttributes,
java.awt.Shape colorShape,
java.util.List<Disposable> dsp) |
static JPopupButton |
createStrokeCapButton(DrawingEditor editor) |
static JPopupButton |
createStrokeCapButton(DrawingEditor editor,
ResourceBundleUtil labels) |
static JPopupButton |
createStrokeCapButton(DrawingEditor editor,
ResourceBundleUtil labels,
java.util.List<Disposable> dsp) |
static JPopupButton |
createStrokeDashesButton(DrawingEditor editor) |
static JPopupButton |
createStrokeDashesButton(DrawingEditor editor,
double[][] dashes) |
static JPopupButton |
createStrokeDashesButton(DrawingEditor editor,
double[][] dashes,
ResourceBundleUtil labels) |
static JPopupButton |
createStrokeDashesButton(DrawingEditor editor,
double[][] dashes,
ResourceBundleUtil labels,
java.util.List<Disposable> dsp) |
static JPopupButton |
createStrokeDashesButton(DrawingEditor editor,
ResourceBundleUtil labels) |
static JPopupButton |
createStrokeDecorationButton(DrawingEditor editor) |
static JPopupButton |
createStrokeJoinButton(DrawingEditor editor) |
static JPopupButton |
createStrokeJoinButton(DrawingEditor editor,
ResourceBundleUtil labels) |
static JPopupButton |
createStrokeJoinButton(DrawingEditor editor,
ResourceBundleUtil labels,
java.util.List<Disposable> dsp) |
static JPopupButton |
createStrokePlacementButton(DrawingEditor editor) |
static JPopupButton |
createStrokeTypeButton(DrawingEditor editor) |
static JPopupButton |
createStrokeWidthButton(DrawingEditor editor) |
static JPopupButton |
createStrokeWidthButton(DrawingEditor editor,
double[] widths) |
static JPopupButton |
createStrokeWidthButton(DrawingEditor editor,
double[] widths,
ResourceBundleUtil labels) |
static JPopupButton |
createStrokeWidthButton(DrawingEditor editor,
ResourceBundleUtil labels) |
static javax.swing.AbstractButton |
createToggleGridButton(DrawingView view)
Creates a button which toggles between two GridConstrainer for
a DrawingView.
|
static javax.swing.AbstractButton |
createZoomButton(DrawingEditor editor) |
static javax.swing.AbstractButton |
createZoomButton(DrawingView view) |
static javax.swing.AbstractButton |
createZoomButton(DrawingView view,
double[] factors) |
public static final java.util.List<ColorIcon> DEFAULT_COLORS
public static final int DEFAULT_COLORS_COLUMN_COUNT
public static final java.util.List<ColorIcon> WEBSAVE_COLORS
public static final int WEBSAVE_COLORS_COLUMN_COUNT
public static final java.util.List<ColorIcon> HSB_COLORS
This is a 'human friendly' color palette which arranges the color in a way that makes it easy for humans to select the desired color. The colors are ordered in a way which minimizes the color contrast effect in the human visual system.
This palette has 12 columns and 10 rows.
The topmost row contains a null-color and a gray scale from white to black in 10 percent steps.
The remaining rows contain colors taken from the outer hull of the HSB color model:
The columns are ordered by hue starting with red - the lowest wavelength - and ending with purple - the highest wavelength. There are 12 different hues, so that all primary colors with their additive complements can be selected.
The rows are orderd by brightness with the brightest color at the top (sky) and the darkest color at the bottom (earth). The first 5 rows contain colors with maximal brightness and a saturation ranging form 20% up to 100%. The remaining 4 rows contain colors with maximal saturation and a brightness ranging from 90% to 20% (this also makes for a range from 100% to 20% if the 5th row is taken into account).
public static final int HSB_COLORS_COLUMN_COUNT
public static final java.util.List<ColorIcon> HSB_COLORS_AS_RGB
public static final int HSB_COLORS_AS_RGB_COLUMN_COUNT
public static java.util.Collection<javax.swing.Action> createDrawingActions(DrawingEditor editor)
public static java.util.Collection<javax.swing.Action> createDrawingActions(DrawingEditor editor, java.util.List<Disposable> dsp)
public static java.util.Collection<javax.swing.Action> createSelectionActions(DrawingEditor editor)
public static javax.swing.JToggleButton addSelectionToolTo(javax.swing.JToolBar tb, DrawingEditor editor)
public static javax.swing.JToggleButton addSelectionToolTo(javax.swing.JToolBar tb, DrawingEditor editor, java.util.Collection<javax.swing.Action> drawingActions, java.util.Collection<javax.swing.Action> selectionActions)
public static javax.swing.JToggleButton addSelectionToolTo(javax.swing.JToolBar tb, DrawingEditor editor, Tool selectionTool)
public static javax.swing.JToggleButton addToolTo(javax.swing.JToolBar tb, DrawingEditor editor, Tool tool, java.lang.String labelKey, ResourceBundleUtil labels)
public static void addZoomButtonsTo(javax.swing.JToolBar bar, DrawingEditor editor)
public static javax.swing.AbstractButton createZoomButton(DrawingEditor editor)
public static javax.swing.AbstractButton createZoomButton(DrawingView view)
public static javax.swing.AbstractButton createZoomButton(DrawingView view, double[] factors)
public static void addAttributesButtonsTo(javax.swing.JToolBar bar, DrawingEditor editor)
public static void addColorButtonsTo(javax.swing.JToolBar bar, DrawingEditor editor)
public static void addColorButtonsTo(javax.swing.JToolBar bar, DrawingEditor editor, java.util.List<ColorIcon> colors, int columnCount)
public static JPopupButton createEditorColorButton(DrawingEditor editor, AttributeKey<java.awt.Color> attributeKey, java.util.List<ColorIcon> swatches, int columnCount, java.lang.String labelKey, ResourceBundleUtil labels)
editor
- The DrawingEditor.attributeKey
- The AttributeKey of the color.swatches
- A list with labeled colors containing the color palette
of the popup menu. The actual labels are retrieved from the supplied
resource bundle. This is usually a LinkedMap, so that the colors have
a predictable order.columnCount
- The number of columns of the color palette.labelKey
- The resource bundle key used for retrieving the icon and
the tooltip of the button.labels
- The resource bundle.public static JPopupButton createEditorColorButton(DrawingEditor editor, AttributeKey<java.awt.Color> attributeKey, java.util.List<ColorIcon> swatches, int columnCount, java.lang.String labelKey, ResourceBundleUtil labels, java.util.Map<AttributeKey,java.lang.Object> defaultAttributes)
editor
- The DrawingEditor.attributeKey
- The AttributeKey of the color.swatches
- A list with labeled colors containing the color palette
of the popup menu. The actual labels are retrieved from the supplied
resource bundle. This is usually a LinkedMap, so that the colors have
a predictable order.columnCount
- The number of columns of the color palette.labelKey
- The resource bundle key used for retrieving the icon and
the tooltip of the button.labels
- The resource bundle.defaultAttributes
- A set of attributes which are also applied to
the selected figures, when a color is selected. This can be used, to
set attributes that otherwise prevent the color from being shown. For
example, when the color attribute is set, we wan't the gradient attribute
of the Figure to be cleared.public static JPopupButton createEditorColorButton(DrawingEditor editor, AttributeKey<java.awt.Color> attributeKey, java.util.List<ColorIcon> swatches, int columnCount, java.lang.String labelKey, ResourceBundleUtil labels, java.util.Map<AttributeKey,java.lang.Object> defaultAttributes, java.awt.Shape colorShape)
editor
- The DrawingEditor.attributeKey
- The AttributeKey of the color.swatches
- A list with labeled colors containing the color palette
of the popup menu. The actual labels are retrieved from the supplied
resource bundle. This is usually a LinkedHashMap, so that the colors have
a predictable order.columnCount
- The number of columns of the color palette.labelKey
- The resource bundle key used for retrieving the icon and
the tooltip of the button.labels
- The resource bundle.defaultAttributes
- A set of attributes which are also applied to
the selected figures, when a color is selected. This can be used, to
set attributes that otherwise prevent the color from being shown. For
example, when the color attribute is set, we wan't the gradient attribute
of the Figure to be cleared.colorShape
- This shape is superimposed on the icon of the button.
The shape is drawn with the default color of the DrawingEditor.public static JPopupButton createSelectionColorButton(DrawingEditor editor, AttributeKey<java.awt.Color> attributeKey, java.util.List<ColorIcon> swatches, int columnCount, java.lang.String labelKey, ResourceBundleUtil labels)
editor
- The DrawingEditor.attributeKey
- The AttributeKey of the color.swatches
- A list with labeled colors containing the color palette
of the popup menu. The actual labels are retrieved from the supplied
resource bundle. This is usually a LinkedHashMap, so that the colors have
a predictable order.columnCount
- The number of columns of the color palette.labelKey
- The resource bundle key used for retrieving the icon and
the tooltip of the button.labels
- The resource bundle.public static JPopupButton createSelectionColorButton(DrawingEditor editor, AttributeKey<java.awt.Color> attributeKey, java.util.List<ColorIcon> swatches, int columnCount, java.lang.String labelKey, ResourceBundleUtil labels, java.util.Map<AttributeKey,java.lang.Object> defaultAttributes)
editor
- The DrawingEditor.attributeKey
- The AttributeKey of the color.swatches
- A list with labeled colors containing the color palette
of the popup menu. The actual labels are retrieved from the supplied
resource bundle. This is usually a LinkedHashMap, so that the colors have
a predictable order.columnCount
- The number of columns of the color palette.labelKey
- The resource bundle key used for retrieving the icon and
the tooltip of the button.labels
- The resource bundle.defaultAttributes
- A set of attributes which are also applied to
the selected figures, when a color is selected. This can be used, to
set attributes that otherwise prevent the color from being shown. For
example, when the color attribute is set, we wan't the gradient attribute
of the Figure to be cleared.public static JPopupButton createSelectionColorButton(DrawingEditor editor, AttributeKey<java.awt.Color> attributeKey, java.util.List<ColorIcon> swatches, int columnCount, java.lang.String labelKey, ResourceBundleUtil labels, java.util.Map<AttributeKey,java.lang.Object> defaultAttributes, java.awt.Shape colorShape)
editor
- The DrawingEditor.attributeKey
- The AttributeKey of the color.swatches
- A list with labeled colors containing the color palette
of the popup menu. The actual labels are retrieved from the supplied
resource bundle. This is usually a LinkedHashMap, so that the colors have
a predictable order.columnCount
- The number of columns of the color palette.labelKey
- The resource bundle key used for retrieving the icon and
the tooltip of the button.labels
- The resource bundle.defaultAttributes
- A set of attributes which are also applied to
the selected figures, when a color is selected. This can be used, to
set attributes that otherwise prevent the color from being shown. For
example, when the color attribute is set, we wan't the gradient attribute
of the Figure to be cleared.colorShape
- This shape is superimposed on the icon of the button.
The shape is drawn with the default color of the DrawingEditor.public static JPopupButton createSelectionColorButton(DrawingEditor editor, AttributeKey<java.awt.Color> attributeKey, java.util.List<ColorIcon> swatches, int columnCount, java.lang.String labelKey, ResourceBundleUtil labels, java.util.Map<AttributeKey,java.lang.Object> defaultAttributes, java.awt.Shape colorShape, java.util.List<Disposable> dsp)
editor
- The DrawingEditor.attributeKey
- The AttributeKey of the color.swatches
- A list with labeled colors containing the color palette
of the popup menu. The actual labels are retrieved from the supplied
resource bundle. This is usually a LinkedHashMap, so that the colors have
a predictable order.columnCount
- The number of columns of the color palette.labelKey
- The resource bundle key used for retrieving the icon and
the tooltip of the button.labels
- The resource bundle.defaultAttributes
- A set of attributes which are also applied to
the selected figures, when a color is selected. This can be used, to
set attributes that otherwise prevent the color from being shown. For
example, when the color attribute is set, we wan't the gradient attribute
of the Figure to be cleared.colorShape
- This shape is superimposed on the icon of the button.
The shape is drawn with the default color of the DrawingEditor.public static JPopupButton createSelectionColorChooserButton(DrawingEditor editor, AttributeKey<java.awt.Color> attributeKey, java.lang.String labelKey, ResourceBundleUtil labels, java.util.Map<AttributeKey,java.lang.Object> defaultAttributes, java.awt.Shape colorShape, java.util.List<Disposable> dsp)
public static JPopupButton createSelectionColorChooserButton(DrawingEditor editor, AttributeKey<java.awt.Color> attributeKey, java.lang.String labelKey, ResourceBundleUtil labels, java.util.Map<AttributeKey,java.lang.Object> defaultAttributes, java.awt.Shape colorShape, java.lang.Class uiclass, java.util.List<Disposable> dsp)
public static JPopupButton createDrawingColorButton(DrawingEditor editor, AttributeKey<java.awt.Color> attributeKey, java.util.List<ColorIcon> swatches, int columnCount, java.lang.String labelKey, ResourceBundleUtil labels)
editor
- The DrawingEditor.attributeKey
- The AttributeKey of the color.swatches
- A list with labeled colors containing the color palette
of the popup menu. The actual labels are retrieved from the supplied
resource bundle. This is usually a LinkedHashMap, so that the colors have
a predictable order.columnCount
- The number of columns of the color palette.labelKey
- The resource bundle key used for retrieving the icon and
the tooltip of the button.labels
- The resource bundle.public static JPopupButton createDrawingColorButton(DrawingEditor editor, AttributeKey<java.awt.Color> attributeKey, java.util.List<ColorIcon> swatches, int columnCount, java.lang.String labelKey, ResourceBundleUtil labels, java.util.Map<AttributeKey,java.lang.Object> defaultAttributes)
editor
- The DrawingEditor.attributeKey
- The AttributeKey of the color.swatches
- A list with labeled colors containing the color palette
of the popup menu. The actual labels are retrieved from the supplied
resource bundle. This is usually a LinkedHashMap, so that the colors have
a predictable order.columnCount
- The number of columns of the color palette.labelKey
- The resource bundle key used for retrieving the icon and
the tooltip of the button.labels
- The resource bundle.defaultAttributes
- A set of attributes which are also applied to
the selected figures, when a color is selected. This can be used, to
set attributes that otherwise prevent the color from being shown. For
example, when the color attribute is set, we wan't the gradient attribute
of the Figure to be cleared.public static JPopupButton createDrawingColorButton(DrawingEditor editor, AttributeKey<java.awt.Color> attributeKey, java.util.List<ColorIcon> swatches, int columnCount, java.lang.String labelKey, ResourceBundleUtil labels, java.util.Map<AttributeKey,java.lang.Object> defaultAttributes, java.awt.Shape colorShape)
editor
- The DrawingEditor.attributeKey
- The AttributeKey of the color.swatches
- A list with labeled colors containing the color palette
of the popup menu. The actual labels are retrieved from the supplied
resource bundle. This is usually a LinkedHashMap, so that the colors have
a predictable order.columnCount
- The number of columns of the color palette.labelKey
- The resource bundle key used for retrieving the icon and
the tooltip of the button.labels
- The resource bundle.defaultAttributes
- A set of attributes which are also applied to
the selected figures, when a color is selected. This can be used, to
set attributes that otherwise prevent the color from being shown. For
example, when the color attribute is set, we wan't the gradient attribute
of the Figure to be cleared.colorShape
- This shape is superimposed on the icon of the button.
The shape is drawn with the default color of the DrawingEditor.public static JPopupButton createDrawingColorButton(DrawingEditor editor, AttributeKey<java.awt.Color> attributeKey, java.util.List<ColorIcon> swatches, int columnCount, java.lang.String labelKey, ResourceBundleUtil labels, java.util.Map<AttributeKey,java.lang.Object> defaultAttributes, java.awt.Shape colorShape, java.util.List<Disposable> dsp)
editor
- The DrawingEditor.attributeKey
- The AttributeKey of the color.swatches
- A list with labeled colors containing the color palette
of the popup menu. The actual labels are retrieved from the supplied
resource bundle. This is usually a LinkedHashMap, so that the colors have
a predictable order.columnCount
- The number of columns of the color palette.labelKey
- The resource bundle key used for retrieving the icon and
the tooltip of the button.labels
- The resource bundle.defaultAttributes
- A set of attributes which are also applied to
the selected figures, when a color is selected. This can be used, to
set attributes that otherwise prevent the color from being shown. For
example, when the color attribute is set, we wan't the gradient attribute
of the Figure to be cleared.colorShape
- This shape is superimposed on the icon of the button.
The shape is drawn with the default color of the DrawingEditor.public static JPopupButton createDrawingColorChooserButton(DrawingEditor editor, AttributeKey<java.awt.Color> attributeKey, java.lang.String labelKey, ResourceBundleUtil labels, java.util.Map<AttributeKey,java.lang.Object> defaultAttributes, java.awt.Shape colorShape, java.util.List<Disposable> dsp)
public static JPopupButton createDrawingColorChooserButton(DrawingEditor editor, AttributeKey<java.awt.Color> attributeKey, java.lang.String labelKey, ResourceBundleUtil labels, java.util.Map<AttributeKey,java.lang.Object> defaultAttributes, java.awt.Shape colorShape, java.lang.Class uiclass, java.util.List<Disposable> dsp)
public static void addStrokeButtonsTo(javax.swing.JToolBar bar, DrawingEditor editor)
public static JPopupButton createStrokeWidthButton(DrawingEditor editor)
public static JPopupButton createStrokeWidthButton(DrawingEditor editor, ResourceBundleUtil labels)
public static JPopupButton createStrokeWidthButton(DrawingEditor editor, double[] widths)
public static JPopupButton createStrokeWidthButton(DrawingEditor editor, double[] widths, ResourceBundleUtil labels)
public static JPopupButton createStrokeDecorationButton(DrawingEditor editor)
public static JPopupButton createStrokeDashesButton(DrawingEditor editor)
public static JPopupButton createStrokeDashesButton(DrawingEditor editor, ResourceBundleUtil labels)
public static JPopupButton createStrokeDashesButton(DrawingEditor editor, double[][] dashes)
public static JPopupButton createStrokeDashesButton(DrawingEditor editor, double[][] dashes, ResourceBundleUtil labels)
public static JPopupButton createStrokeDashesButton(DrawingEditor editor, double[][] dashes, ResourceBundleUtil labels, java.util.List<Disposable> dsp)
public static JPopupButton createStrokeTypeButton(DrawingEditor editor)
public static JPopupButton createStrokePlacementButton(DrawingEditor editor)
public static void addFontButtonsTo(javax.swing.JToolBar bar, DrawingEditor editor)
public static JPopupButton createFontButton(DrawingEditor editor)
public static JPopupButton createFontButton(DrawingEditor editor, ResourceBundleUtil labels)
public static JPopupButton createFontButton(DrawingEditor editor, AttributeKey<java.awt.Font> key, ResourceBundleUtil labels)
public static JPopupButton createFontButton(DrawingEditor editor, AttributeKey<java.awt.Font> key, ResourceBundleUtil labels, java.util.List<Disposable> dsp)
public static javax.swing.JButton createFontStyleBoldButton(DrawingEditor editor)
public static javax.swing.JButton createFontStyleBoldButton(DrawingEditor editor, ResourceBundleUtil labels)
public static javax.swing.JButton createFontStyleBoldButton(DrawingEditor editor, ResourceBundleUtil labels, java.util.List<Disposable> dsp)
public static javax.swing.JButton createFontStyleItalicButton(DrawingEditor editor)
public static javax.swing.JButton createFontStyleItalicButton(DrawingEditor editor, ResourceBundleUtil labels)
public static javax.swing.JButton createFontStyleItalicButton(DrawingEditor editor, ResourceBundleUtil labels, java.util.List<Disposable> dsp)
public static javax.swing.JButton createFontStyleUnderlineButton(DrawingEditor editor)
public static javax.swing.JButton createFontStyleUnderlineButton(DrawingEditor editor, ResourceBundleUtil labels)
public static javax.swing.JButton createFontStyleUnderlineButton(DrawingEditor editor, ResourceBundleUtil labels, java.util.List<Disposable> dsp)
public static void addAlignmentButtonsTo(javax.swing.JToolBar bar, DrawingEditor editor)
public static void addAlignmentButtonsTo(javax.swing.JToolBar bar, DrawingEditor editor, java.util.List<Disposable> dsp)
public static javax.swing.AbstractButton createToggleGridButton(DrawingView view)
public static JPopupButton createStrokeCapButton(DrawingEditor editor)
public static JPopupButton createStrokeCapButton(DrawingEditor editor, ResourceBundleUtil labels)
public static JPopupButton createStrokeCapButton(DrawingEditor editor, ResourceBundleUtil labels, java.util.List<Disposable> dsp)
public static JPopupButton createStrokeJoinButton(DrawingEditor editor)
public static JPopupButton createStrokeJoinButton(DrawingEditor editor, ResourceBundleUtil labels)
public static JPopupButton createStrokeJoinButton(DrawingEditor editor, ResourceBundleUtil labels, java.util.List<Disposable> dsp)
public static javax.swing.JButton createPickAttributesButton(DrawingEditor editor)
public static javax.swing.JButton createPickAttributesButton(DrawingEditor editor, java.util.List<Disposable> dsp)
public static javax.swing.JButton createApplyAttributesButton(DrawingEditor editor)
public static javax.swing.JButton createApplyAttributesButton(DrawingEditor editor, java.util.List<Disposable> dsp)