rsramanujam.ui
Class RSRFontDialog

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Dialog
                          |
                          +--javax.swing.JDialog
                                |
                                +--rsramanujam.ui.RSRFontDialog

public class RSRFontDialog
extends javax.swing.JDialog
implements RSRConstants, java.awt.event.ActionListener, javax.swing.event.ListSelectionListener

RSRFontDialog - A Standard font dialog implementation using Java.

Version:
1.0.0 Kamadhenu, an open source repository of user intercace and support utility components Copyright (C) 2002 R Sadagopa Ramanujam This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA R Sadagopa Ramanujam
See Also:
Serialized Form

Inner classes inherited from class javax.swing.JDialog
javax.swing.JDialog.AccessibleJDialog
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AWTTreeLock
 
Field Summary
private  javax.swing.JButton g_bCancel
           
private  javax.swing.JButton g_bOK
           
private  javax.swing.JPanel g_JDialogContentPane
           
private  javax.swing.JLabel g_lFontName
           
private  javax.swing.JLabel g_lFontSizes
           
private  javax.swing.JLabel g_lFontStyle
           
private  javax.swing.JList g_listFontNames
           
private  javax.swing.JList g_listFontSizes
           
private  javax.swing.JList g_listFontStyles
           
private  javax.swing.JLabel g_lPreview
           
private  javax.swing.JPanel g_pFontNames
           
private  javax.swing.JPanel g_pFontSizes
           
private  javax.swing.JPanel g_pFontStyles
           
private  javax.swing.JScrollPane g_scrFontName
           
private  javax.swing.JScrollPane g_scrFontSize
           
private  javax.swing.JScrollPane g_scrFontStyles
           
private  java.lang.String[] g_strFontNamesArr
           
private  java.util.Vector g_vFontSizes
           
private  java.util.Vector g_vFontStyles
           
private  int option
           
private  java.awt.Font selectedFont
           
private  java.lang.String selectedFontName
           
private  int selectedFontSize
           
private  int selectedFontStyle
           
 
Fields inherited from class javax.swing.JDialog
accessibleContext, defaultCloseOperation, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Dialog
base, keepBlocking, modal, nameCounter, resizable, serialVersionUID, title
 
Fields inherited from class java.awt.Window
active, base, focusMgr, inputContext, nameCounter, nativeActive, OPENED, ownedWindowList, serialVersionUID, state, warningString, weakThis, windowListener, windowSerializedDataVersion
 
Fields inherited from class java.awt.Container
component, containerListener, containerSerializedDataVersion, dispatcher, layoutMgr, maxSize, ncomponents, serialVersionUID
 
Fields inherited from class java.awt.Component
actionListenerK, adjustmentListenerK, appContext, assert, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, hasFocus, height, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, RIGHT_ALIGNMENT, serialVersionUID, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowListenerK, x, y
 
Fields inherited from interface rsramanujam.uis.RSRConstants
CANCEL_OPTION, OK_OPTION
 
Constructor Summary
RSRFontDialog()
           
RSRFontDialog(javax.swing.JDialog parent)
           
RSRFontDialog(javax.swing.JFrame parent)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
          Invoked when an action occurs.
private  javax.swing.JButton getbCancel()
          Return the bCancel property value.
private  javax.swing.JButton getbOK()
          Return the bOK property value.
 java.util.Vector getG_vFontSizes()
          This method returns a vector of primitive integers Creation date: (1/13/2003 1:59:43 PM)
 java.util.Vector getG_vFontStyles()
          Insert the method's description here.
private  javax.swing.JPanel getJDialogContentPane()
          Return the JDialogContentPane property value.
private  javax.swing.JLabel getlFontName()
          Return the lFontName property value.
private  javax.swing.JLabel getlFontSizes()
          Return the lFontSizes property value.
private  javax.swing.JLabel getlFontStyle()
          Return the lFontStyle property value.
private  javax.swing.JList getlistFontNames()
          Return the listFontNames property value.
private  javax.swing.JList getlistFontSizes()
          Return the listFontSizes property value.
private  javax.swing.JList getlistFontStyles()
          Return the listFontStyles property value.
private  javax.swing.JLabel getlPreview()
          Return the lPreview property value.
 int getOption()
          This method returns whether OK was pressed or Cancel was pressed as an integer.
private  javax.swing.JPanel getpFontNames()
          Return the pFontNames property value.
private  javax.swing.JPanel getpFontSizes()
          Return the pFontSizes property value.
private  javax.swing.JPanel getpFontStyles()
          Return the pFontStyles property value.
private  javax.swing.JScrollPane getscrFontName()
          Return the scrFontName property value.
private  javax.swing.JScrollPane getscrFontSize()
          Return the scrFontSize property value.
private  javax.swing.JScrollPane getscrFontStyles()
          Return the scrFontStyles property value.
 java.awt.Font getSelectedFont()
          This method returns the font selected from the dialog Pressing OK will return the selected font.
 java.lang.String getSelectedFontName()
          This method returns the selected font name Creation date: (1/13/2003 1:57:33 PM)
 int getSelectedFontSize()
          This method returns the selected size for the font Creation date: (1/13/2003 1:57:33 PM)
 int getSelectedFontStyle()
          This method returns the selected style for the font.
private  void initialize()
          Initialize the class.
static void main(java.lang.String[] args)
          main entrypoint - starts the part when it is run as an application
private  void notifyException(java.lang.Throwable exception)
          Called whenever the part throws an exception.
 void setG_vFontSizes(java.util.Vector newG_vFontSizes)
          Insert the method's description here.
 void setG_vFontStyles(java.util.Vector newG_vFontStyles)
          Insert the method's description here.
private  void setOption(int newOption)
          This method sets whether the user pressed OK or Cancel by referring to them using the constants OK_OPTION and CANCEL_OPTION respectively of the interface RSRConstants
private  void setSelectedFont(java.awt.Font newSelectedFont)
          Insert the method's description here.
private  void setSelectedFontName(java.lang.String newSelectedFontName)
          Insert the method's description here.
private  void setSelectedFontSize(int newSelectedFontSize)
          Insert the method's description here.
private  void setSelectedFontStyle(int newSelectedFontStyle)
          Insert the method's description here.
private  void startup()
          This method assigns listeners to the lists and buttons and populates the lists with the required data.
 void valueChanged(javax.swing.event.ListSelectionEvent e)
          This method will set the font to the selected font as and when a change is made to the list
 
Methods inherited from class javax.swing.JDialog
addImpl, createRootPane, createRootPaneException, dialogInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setLocationRelativeTo, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Dialog
, addNotify, conditionalShow, constructComponentName, dispose, getTitle, hide, hideAndDisposeHandler, initIDs, isModal, isResizable, setModal, setResizable, setTitle, show
 
Methods inherited from class java.awt.Window
addOwnedWindow, addWindowListener, applyResourceBundle, applyResourceBundle, connectOwnedWindow, dispatchEventImpl, eventEnabled, finalize, getFocusOwner, getInputContext, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, isActive, isShowing, nextFocus, ownedInit, pack, postEvent, postProcessKeyEvent, postWindowEvent, preProcessKeyEvent, processEvent, readObject, removeOwnedWindow, removeWindowListener, setCursor, setFocusOwner, setWarningString, toBack, toFront, transferFocus, writeObject
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, applyOrientation, countComponents, deliverEvent, dispatchEventToSelf, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents_NoClientCode, getComponents, getCursorTarget, getInsets, getLayout, getMaximumSize, getMinimumSize, getMouseEventTarget, getPreferredSize, getWindow, insets, invalidate, invalidateTree, isAncestorOf, layout, lightweightPrint, list, list, locate, minimumSize, paint, paintComponents, postsOldMouseEvents, preferredSize, print, printComponents, printOneComponent, processContainerEvent, proxyEnableEvents, proxyRequestFocus, remove, removeAll, removeContainerListener, removeNotify, setFont, updateCursor, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputMethodRequests, getIntrinsicCursor, getLocation, getLocation, getLocationOnScreen, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getSize, getSize, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processInputMethodEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setDropTarget, setEnabled, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, size, toString, transferFocus
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

g_bCancel

private javax.swing.JButton g_bCancel

g_bOK

private javax.swing.JButton g_bOK

g_JDialogContentPane

private javax.swing.JPanel g_JDialogContentPane

g_lFontName

private javax.swing.JLabel g_lFontName

g_lFontSizes

private javax.swing.JLabel g_lFontSizes

g_lFontStyle

private javax.swing.JLabel g_lFontStyle

g_listFontNames

private javax.swing.JList g_listFontNames

g_listFontSizes

private javax.swing.JList g_listFontSizes

g_listFontStyles

private javax.swing.JList g_listFontStyles

g_lPreview

private javax.swing.JLabel g_lPreview

g_pFontNames

private javax.swing.JPanel g_pFontNames

g_pFontSizes

private javax.swing.JPanel g_pFontSizes

g_pFontStyles

private javax.swing.JPanel g_pFontStyles

g_scrFontName

private javax.swing.JScrollPane g_scrFontName

g_scrFontSize

private javax.swing.JScrollPane g_scrFontSize

g_scrFontStyles

private javax.swing.JScrollPane g_scrFontStyles

g_vFontStyles

private java.util.Vector g_vFontStyles

g_vFontSizes

private java.util.Vector g_vFontSizes

g_strFontNamesArr

private java.lang.String[] g_strFontNamesArr

selectedFontName

private java.lang.String selectedFontName

selectedFontStyle

private int selectedFontStyle

selectedFontSize

private int selectedFontSize

selectedFont

private java.awt.Font selectedFont

option

private int option
Constructor Detail

RSRFontDialog

public RSRFontDialog()

RSRFontDialog

public RSRFontDialog(javax.swing.JDialog parent)

RSRFontDialog

public RSRFontDialog(javax.swing.JFrame parent)
Method Detail

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Invoked when an action occurs.
Specified by:
actionPerformed in interface java.awt.event.ActionListener

getbCancel

private javax.swing.JButton getbCancel()
Return the bCancel property value.
Returns:
javax.swing.JButton

getbOK

private javax.swing.JButton getbOK()
Return the bOK property value.
Returns:
javax.swing.JButton

getG_vFontSizes

public java.util.Vector getG_vFontSizes()
This method returns a vector of primitive integers Creation date: (1/13/2003 1:59:43 PM)
Returns:
java.util.Vector

getG_vFontStyles

public java.util.Vector getG_vFontStyles()
Insert the method's description here. Creation date: (1/13/2003 1:59:43 PM)
Returns:
java.util.Vector

getJDialogContentPane

private javax.swing.JPanel getJDialogContentPane()
Return the JDialogContentPane property value.
Returns:
javax.swing.JPanel

getlFontName

private javax.swing.JLabel getlFontName()
Return the lFontName property value.
Returns:
javax.swing.JLabel

getlFontSizes

private javax.swing.JLabel getlFontSizes()
Return the lFontSizes property value.
Returns:
javax.swing.JLabel

getlFontStyle

private javax.swing.JLabel getlFontStyle()
Return the lFontStyle property value.
Returns:
javax.swing.JLabel

getlistFontNames

private javax.swing.JList getlistFontNames()
Return the listFontNames property value.
Returns:
javax.swing.JList

getlistFontSizes

private javax.swing.JList getlistFontSizes()
Return the listFontSizes property value.
Returns:
javax.swing.JList

getlistFontStyles

private javax.swing.JList getlistFontStyles()
Return the listFontStyles property value.
Returns:
javax.swing.JList

getlPreview

private javax.swing.JLabel getlPreview()
Return the lPreview property value.
Returns:
javax.swing.JLabel

getOption

public int getOption()
This method returns whether OK was pressed or Cancel was pressed as an integer. OK is denoted by OK_OPTION and Cancel is denoted by CANCEL_OPTION of the interface RSRConstants. Creation date: (1/14/2003 10:03:15 AM)
Returns:
int

getpFontNames

private javax.swing.JPanel getpFontNames()
Return the pFontNames property value.
Returns:
javax.swing.JPanel

getpFontSizes

private javax.swing.JPanel getpFontSizes()
Return the pFontSizes property value.
Returns:
javax.swing.JPanel

getpFontStyles

private javax.swing.JPanel getpFontStyles()
Return the pFontStyles property value.
Returns:
javax.swing.JPanel

getscrFontName

private javax.swing.JScrollPane getscrFontName()
Return the scrFontName property value.
Returns:
javax.swing.JScrollPane

getscrFontSize

private javax.swing.JScrollPane getscrFontSize()
Return the scrFontSize property value.
Returns:
javax.swing.JScrollPane

getscrFontStyles

private javax.swing.JScrollPane getscrFontStyles()
Return the scrFontStyles property value.
Returns:
javax.swing.JScrollPane

getSelectedFont

public java.awt.Font getSelectedFont()
This method returns the font selected from the dialog Pressing OK will return the selected font. Cancel will return the default 12 point bold Dialog font
Returns:
java.awt.Font

getSelectedFontName

public java.lang.String getSelectedFontName()
This method returns the selected font name Creation date: (1/13/2003 1:57:33 PM)
Returns:
java.lang.String

getSelectedFontSize

public int getSelectedFontSize()
This method returns the selected size for the font Creation date: (1/13/2003 1:57:33 PM)
Returns:
int

getSelectedFontStyle

public int getSelectedFontStyle()
This method returns the selected style for the font. Creation date: (1/13/2003 1:57:33 PM)
Returns:
int

initialize

private void initialize()
Initialize the class.

main

public static void main(java.lang.String[] args)
main entrypoint - starts the part when it is run as an application
Parameters:
args - java.lang.String[]

notifyException

private void notifyException(java.lang.Throwable exception)
Called whenever the part throws an exception.
Parameters:
exception - java.lang.Throwable

setG_vFontSizes

public void setG_vFontSizes(java.util.Vector newG_vFontSizes)
Insert the method's description here. Creation date: (1/13/2003 1:59:43 PM)
Parameters:
newG_vFontSizes - java.util.Vector

setG_vFontStyles

public void setG_vFontStyles(java.util.Vector newG_vFontStyles)
Insert the method's description here. Creation date: (1/13/2003 1:59:43 PM)
Parameters:
newG_vFontStyles - java.util.Vector

setOption

private void setOption(int newOption)
This method sets whether the user pressed OK or Cancel by referring to them using the constants OK_OPTION and CANCEL_OPTION respectively of the interface RSRConstants
Parameters:
newOption - int

setSelectedFont

private void setSelectedFont(java.awt.Font newSelectedFont)
Insert the method's description here. Creation date: (1/13/2003 1:57:33 PM)
Parameters:
newSelectedFont - java.awt.Font

setSelectedFontName

private void setSelectedFontName(java.lang.String newSelectedFontName)
Insert the method's description here. Creation date: (1/13/2003 1:57:33 PM)
Parameters:
newSelectedFontName - java.lang.String

setSelectedFontSize

private void setSelectedFontSize(int newSelectedFontSize)
Insert the method's description here. Creation date: (1/13/2003 1:57:33 PM)
Parameters:
newSelectedFontSize - int

setSelectedFontStyle

private void setSelectedFontStyle(int newSelectedFontStyle)
Insert the method's description here. Creation date: (1/13/2003 1:57:33 PM)
Parameters:
newSelectedFontStyle - int

startup

private void startup()
This method assigns listeners to the lists and buttons and populates the lists with the required data. Creation date: (1/13/2003 12:59:51 PM)

valueChanged

public void valueChanged(javax.swing.event.ListSelectionEvent e)
This method will set the font to the selected font as and when a change is made to the list
Specified by:
valueChanged in interface javax.swing.event.ListSelectionListener
Parameters:
e - the event that characterizes the change.