|
Java 6 SE Platform 6.0 Home |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Window
java.awt.Frame
javax.swing.JFrame
com.woven_media.colorsafe.ColorModelView
public class ColorModelView
ColorModelView class extends javax.swing.JFrame
and handles
creation of the various color palettes and palette views for the
ColorSafe
GUI.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JFrame |
---|
javax.swing.JFrame.AccessibleJFrame |
Nested classes/interfaces inherited from class java.awt.Frame |
---|
java.awt.Frame.AccessibleAWTFrame |
Nested classes/interfaces inherited from class java.awt.Window |
---|
java.awt.Window.AccessibleAWTWindow |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary | |
---|---|
private int |
b
|
private java.awt.Color |
c
|
private Controller |
controller
|
private java.awt.Container |
cp
|
private static int |
ctr
|
private static java.lang.String |
errmsg
|
private static javax.swing.JFrame |
frame
|
private int |
g
|
private java.awt.GridBagLayout |
gb
|
private java.awt.GridBagConstraints |
gbc
|
private java.lang.String[] |
hexColors
|
private java.awt.Font |
labelFont
|
private java.lang.String[] |
labels
|
private javax.swing.JLabel |
lblHex
|
private javax.swing.JLabel |
lblRGB
|
private javax.swing.JPanel |
lowerPanel
|
private java.lang.String[] |
namedColors
|
private static int |
numColors
|
private static int |
palette
|
private javax.swing.JPanel[] |
panels
|
private PaletteInfoPanel |
pip
|
private int |
r
|
private static java.util.ResourceBundle |
rb
|
private int[][] |
rgbColors
|
private javax.swing.JPanel |
swatch
|
private java.lang.String |
title
|
private javax.swing.JPanel |
upperPanel
|
private java.net.URL |
url
|
Fields inherited from class javax.swing.JFrame |
---|
accessibleContext, EXIT_ON_CLOSE, rootPane, rootPaneCheckingEnabled |
Fields inherited from class java.awt.Frame |
---|
CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface com.woven_media.colorsafe.IPalette |
---|
BG_VAL, GRAYSCALE_NUM_COLORS, GRAYSCALE_PALETTE, GRAYSCALE_TITLE, HEX_VAL, NAMED_COLORS_PALETTE, NAMED_COLORS_TITLE, NAMED_NUM_COLORS, NETSCAPE_NUM_COLORS, NETSCAPE_PALETTE, NETSCAPE_TITLE, RGB_VAL, WIN_GRAYS_NUM_COLORS, WIN_NUM_COLORS, WINDOWS_GRAYS_PALETTE, WINDOWS_GRAYS_TITLE, WINDOWS_PALETTE, WINDOWS_TITLE, X11_NUM_COLORS, X11_PALETTE, X11_TITLE |
Fields inherited from interface javax.swing.WindowConstants |
---|
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, HIDE_ON_CLOSE |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
ColorModelView(Controller c,
javax.swing.JFrame f,
java.lang.String paletteTitle,
int paletteType)
ColorModelView constructor handles initialization and sets the palette type. |
Method Summary | |
---|---|
void |
colorUI()
Builds the panel matrix UI. |
void |
getColorMatrix()
Determines which palette to build based on constants defined in IPalette
interface and the palette type enum passed to the constructor for this instance. |
int |
getNumColors()
Returns the number of colors for this palette. |
int |
getPalette()
Returns the palette type. |
void |
grayColorMatrix()
Builds either the Windows 256 Grays Palette or standard Grayscale Palette
based on the value of the this.getPalette method. |
private void |
init()
Handles initialization and the PaletteInfoPanel instantiation. |
void |
mouseClicked(java.awt.event.MouseEvent e)
Empty method signature required by the java.awt.event.MouseListener interface. |
void |
mouseEntered(java.awt.event.MouseEvent e)
Handles mouse events entering individual color panels. |
void |
mouseExited(java.awt.event.MouseEvent e)
Reverts back to default cursor when mouse exits a color panel. |
void |
mousePressed(java.awt.event.MouseEvent e)
Empty method signature required by the java.awt.event.MouseListener interface. |
void |
mouseReleased(java.awt.event.MouseEvent e)
Sets the java.awt.Color object by grabbing the client property
"RGBColor" from the javax.swing.JComponent.getClientProperty
method for the selected color panel. |
void |
namedColorMatrix(int type)
Builds the NamedColors palette. |
void |
safeColorMatrix()
Builds either the Windows System Palette or Netscape Palette based
on the value of this.getPalette method. |
void |
setNumColors(int num)
Sets the number of colors for this palette. |
void |
setPalette(int palette)
Sets the palette type member. |
Methods inherited from class javax.swing.JFrame |
---|
addImpl, createRootPane, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, isRootPaneCheckingEnabled, paramString, processWindowEvent, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, setTransferHandler, update |
Methods inherited from class java.awt.Frame |
---|
addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setResizable, setState, setTitle, setUndecorated |
Methods inherited from class java.awt.Window |
---|
addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getGraphicsConfiguration, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOwnedWindows, getOwner, getOwnerlessWindows, getToolkit, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isShowing, pack, postEvent, processEvent, processWindowFocusEvent, processWindowStateEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setVisible, show, toBack, toFront |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paint, paintComponents, preferredSize, print, printComponents, processContainerEvent, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resize, resize, setBackground, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.awt.MenuContainer |
---|
getFont, postEvent |
Field Detail |
---|
private static int ctr
private static int palette
private static int numColors
private static javax.swing.JFrame frame
private java.lang.String[] hexColors
private java.lang.String[] namedColors
private int[][] rgbColors
private javax.swing.JPanel[] panels
private int r
private int g
private int b
private java.awt.Container cp
private java.lang.String[] labels
private java.awt.GridBagLayout gb
private java.awt.GridBagConstraints gbc
private javax.swing.JPanel upperPanel
private javax.swing.JPanel lowerPanel
private javax.swing.JPanel swatch
private javax.swing.JLabel lblRGB
private javax.swing.JLabel lblHex
private java.awt.Font labelFont
private PaletteInfoPanel pip
private java.awt.Color c
private java.lang.String title
private Controller controller
private java.net.URL url
private static java.util.ResourceBundle rb
private static java.lang.String errmsg
Constructor Detail |
---|
public ColorModelView(Controller c, javax.swing.JFrame f, java.lang.String paletteTitle, int paletteType)
c
- reference to the Controller
object.f
- reference to the parent frame.paletteTitle
- title of the selected palette.paletteType
- palette type of the current selection.Method Detail |
---|
private void init()
PaletteInfoPanel
instantiation.
public void colorUI()
public void getColorMatrix()
IPalette
interface and the palette type enum passed to the constructor for this instance.
public void safeColorMatrix()
Windows System Palette
or Netscape Palette
based
on the value of this.getPalette
method.
public void grayColorMatrix()
Windows 256 Grays Palette
or standard Grayscale Palette
based on the value of the this.getPalette
method.
public void namedColorMatrix(int type)
NamedColors
palette. Calls NamedColors
class.
type
- indicates Windows-named color palette or standards-compliant
X11
color palette.public void setNumColors(int num)
num
- int
value representing the number of colors the current palette.public int getNumColors()
int
value representing to number of colors in current palette.public void setPalette(int palette)
palette
- int
value representing the palette type.public int getPalette()
int
value representing the palette type.public void mouseEntered(java.awt.event.MouseEvent e)
PaletteInfoPanel#selectedObject
method.
mouseEntered
in interface java.awt.event.MouseListener
e
- java.awt.event.MouseEvent
parameter.public void mouseReleased(java.awt.event.MouseEvent e)
java.awt.Color
object by grabbing the client property
"RGBColor"
from the javax.swing.JComponent.getClientProperty
method for the selected color panel. Sets the current color and disposes of the palette
frame.
mouseReleased
in interface java.awt.event.MouseListener
e
- java.awt.event.MouseEvent
.JComponent.getClientProperty(java.lang.Object)
public void mouseExited(java.awt.event.MouseEvent e)
mouseExited
in interface java.awt.event.MouseListener
e
- java.awt.event.MouseEvent
required parameter.public void mouseClicked(java.awt.event.MouseEvent e)
java.awt.event.MouseListener
interface.
mouseClicked
in interface java.awt.event.MouseListener
e
- java.awt.event.MouseEvent
required parameter.public void mousePressed(java.awt.event.MouseEvent e)
java.awt.event.MouseListener
interface.
mousePressed
in interface java.awt.event.MouseListener
e
- java.awt.event.MouseEvent
required parameter.
|
Java 6 SE Platform 6.0 Home |
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |