|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JPanel
org.vizzini.ui.text.TextStyleChooser
public class TextStyleChooser
Provides a generic GUI component for selection of a text style. A text style consists of a font, and normal and selection colors.
A text style changed event can be obtained by registering a
java.beans.PropertyChangeListener
using
addTextStyleListener()
.
Listener example:
_textStyleUI.addTextStyleListener(new PropertyChangeListener()
{
public void propertyChange(PropertyChangeEvent event)
{
TextStyleChooser chooser = (TextStyleChooser)event.getSource();
TextStyle textStyle = (TextStyle)event.getNewValue();
// Do something
}
} );
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary | |
---|---|
static String |
TEXT_STYLE_PROPERTY
Name of the text style property. |
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
TextStyleChooser()
Construct this object. |
Method Summary | |
---|---|
void |
addTextStyleListener(PropertyChangeListener listener)
Add a property listener for the color property. |
protected FontChooser |
createFontUI()
Create a font user interface component. |
protected TextColorSetChooser |
createNormalTextColorSetUI()
Create a normal text color set user interface component. |
protected JTextField |
createPreviewUI()
Create a preview user interface component. |
protected TextColorSetChooser |
createSelectionTextColorSetUI()
Create a selection text color set user interface component. |
TextStyle |
getTextStyle()
Return the text style. |
boolean |
isDirty()
|
void |
removeTextStyleListener(PropertyChangeListener listener)
Remove a property listener for the color property. |
void |
setDirty(boolean isDirty)
|
void |
setEnabled(boolean enabled)
Set the enabled state of this widget. |
void |
setPreviewText(String text)
Set the text of the preview widget. |
void |
setPreviewVisible(boolean isVisible)
Set the visibility of the preview widget. |
void |
setSelectionTextColorSetVisible(boolean isVisible)
Set the visibility of the selection text color set user interface component. |
void |
setTextStyle(TextStyle textStyle)
Set the color scheme. |
void |
setTitle(String title)
Create a titled border with the given string. |
protected void |
updatePreviewUIFont()
Update the preview widget for a new font choice. |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final String TEXT_STYLE_PROPERTY
Constructor Detail |
---|
public TextStyleChooser()
Method Detail |
---|
public void addTextStyleListener(PropertyChangeListener listener)
public TextStyle getTextStyle()
public boolean isDirty()
public void removeTextStyleListener(PropertyChangeListener listener)
public void setDirty(boolean isDirty)
isDirty
- The isDirty to set.public void setEnabled(boolean enabled)
setEnabled
in class JComponent
public void setPreviewText(String text)
text
- The new text.public void setPreviewVisible(boolean isVisible)
isVisible
- Flag indicating whether the preview pane is visible.public void setSelectionTextColorSetVisible(boolean isVisible)
isVisible
- public void setTextStyle(TextStyle textStyle)
public void setTitle(String title)
title
- The title for the titled border.protected FontChooser createFontUI()
protected TextColorSetChooser createNormalTextColorSetUI()
protected JTextField createPreviewUI()
protected TextColorSetChooser createSelectionTextColorSetUI()
protected void updatePreviewUIFont()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2007 Vizzini.org. All Rights Reserved. | 2007.12.25.03.00.02 |