Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.fudaa.fudaa.prert.panel
Class PrertPnDialog  view PrertPnDialog download PrertPnDialog.java

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended bycom.memoire.bu.BuPanel
                      extended byorg.fudaa.fudaa.prert.panel.PrertPnDialog
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.awt.event.WindowListener
Direct Known Subclasses:
PrertPnGrille, PrertPnImageRaster, PrertPnSaisiePointPixel

public class PrertPnDialog
extends com.memoire.bu.BuPanel
implements java.awt.event.ActionListener, java.awt.event.WindowListener

Un panneau qui peut etre facilement affichable dans une boite de dialogue. Cette classe reprend le mode de fonctionnement de JOptionPane. Les methodes valide(), actionApply() et actionCancel() peuvent être redefinies : valide() est appele avant d'appliquer les changements ( la methode actionApply() ).

Version:
$Id$

Nested Class Summary
 
Nested classes inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
java.awt.Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  javax.swing.JDialog dialog_
           
protected  boolean modale_
           
static int OK_APPLY_OPTION
           
static int OK_CANCEL_APPLY_OPTION
           
static int OK_CANCEL_OPTION
           
static int OK_OPTION
          Option : uniquement un bouton ok sera affiche.
protected  int option_
           
private  int response_
           
 
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.Container
 
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
PrertPnDialog()
           
PrertPnDialog(int _option)
          Les options possibles les variables statiques OK_OPTION (un bouton ok unique, OK_CANCEL_OPTION,...
 
Method Summary
protected  void actionApply()
          Méthode à surcharger : elle est appelee si le bouton APPLY ou OK est active.
protected  void actionCancel()
          Méthode action pour le bouton CANCEL à surcharger.
 void actionPerformed(java.awt.event.ActionEvent _evt)
          Recupere les evt des boutons ok,cancel et apply.
 void actualiseAffichage()
          maj du layout et de la boite de dialogue.
protected  com.memoire.bu.BuTextField addDoubleText()
           
protected  com.memoire.bu.BuTextField addDoubleText(double _d)
           
 void addEmptyBorder(int _b)
           
protected  com.memoire.bu.BuTextField addIntegerText()
           
protected  com.memoire.bu.BuTextField addIntegerText(int _d)
           
protected  com.memoire.bu.BuLabel addLabel(java.lang.String _l)
           
protected  com.memoire.bu.BuTextField addLabelDoubleText(java.lang.String _label)
           
protected  com.memoire.bu.BuTextField addLabelIntegerText(java.lang.String _label)
           
protected  com.memoire.bu.BuLabel addRedLabel()
          ajoute au panel un label dont la couleur de texte est rouge.
 void affiche(java.awt.Dialog _parent, java.lang.String _titre)
          Affiche le panel dans une boite de dialogue.
 void affiche(java.awt.Frame _parent, java.lang.String _titre)
          Affiche le panel dans une boite de dialogue.
private  int afficheDialog(java.awt.Component _parent)
          Affiche le dialogue et le positionne par rapport a _parent.
 int afficheModale(java.awt.Dialog _parent, java.lang.String _titre)
          Affiche le panel dans une boite de dialogue modale.
 int afficheModale(java.awt.Frame _parent, java.lang.String _titre)
          Affiche le panel dans une boite de dialogue modale.
private  void construireApply(com.memoire.bu.BuPanel _p)
           
private  com.memoire.bu.BuButton construireBuButton(java.lang.String _text, java.lang.String _action)
          Construit un bouton ayant comme label _text et comme "ActionCommand" _action.
private  void construireCancel(com.memoire.bu.BuPanel _p)
           
private  void construireOk(com.memoire.bu.BuPanel _p)
           
private  com.memoire.bu.BuPanel construitDialogPanel()
          Construit le panel de la boite de dialogue.
private  int createDialog(java.awt.Dialog _parent, java.lang.String _titre)
           
private  int createDialog(java.awt.Frame _parent, java.lang.String _titre)
           
private  void fermerDialog()
           
 void setModale(boolean _modale)
           
 boolean valide()
           
 void windowActivated(java.awt.event.WindowEvent e)
          This method is called when a window is activated.
 void windowClosed(java.awt.event.WindowEvent e)
          This method is called when the window is closed.
 void windowClosing(java.awt.event.WindowEvent e)
          This method is called when the user calls the system menu close function, giving the program a chance to cancel the close.
 void windowDeactivated(java.awt.event.WindowEvent e)
          This method is called when the window is deactivated.
 void windowDeiconified(java.awt.event.WindowEvent e)
          This method is called when the window is deiconified.
 void windowIconified(java.awt.event.WindowEvent e)
          This method is called when the window is iconified.
 void windowOpened(java.awt.event.WindowEvent e)
          This method is called when the window is made visible.
 
Methods inherited from class com.memoire.bu.BuPanel
paint, paintComponent
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OK_OPTION

public static final int OK_OPTION
Option : uniquement un bouton ok sera affiche. Reponse donnee par le dialogue si le bouton "ok" utilise.

See Also:
Constant Field Values

OK_CANCEL_OPTION

public static final int OK_CANCEL_OPTION
See Also:
Constant Field Values

OK_APPLY_OPTION

public static final int OK_APPLY_OPTION
See Also:
Constant Field Values

OK_CANCEL_APPLY_OPTION

public static final int OK_CANCEL_APPLY_OPTION
See Also:
Constant Field Values

option_

protected int option_

modale_

protected boolean modale_

dialog_

protected javax.swing.JDialog dialog_

response_

private int response_
Constructor Detail

PrertPnDialog

public PrertPnDialog()

PrertPnDialog

public PrertPnDialog(int _option)
Les options possibles les variables statiques OK_OPTION (un bouton ok unique, OK_CANCEL_OPTION,...

Method Detail

setModale

public void setModale(boolean _modale)

valide

public boolean valide()

affiche

public void affiche(java.awt.Dialog _parent,
                    java.lang.String _titre)
Affiche le panel dans une boite de dialogue.


affiche

public void affiche(java.awt.Frame _parent,
                    java.lang.String _titre)
Affiche le panel dans une boite de dialogue.


createDialog

private int createDialog(java.awt.Frame _parent,
                         java.lang.String _titre)

createDialog

private int createDialog(java.awt.Dialog _parent,
                         java.lang.String _titre)

afficheModale

public int afficheModale(java.awt.Dialog _parent,
                         java.lang.String _titre)
Affiche le panel dans une boite de dialogue modale.


afficheModale

public int afficheModale(java.awt.Frame _parent,
                         java.lang.String _titre)
Affiche le panel dans une boite de dialogue modale.


addEmptyBorder

public void addEmptyBorder(int _b)

afficheDialog

private int afficheDialog(java.awt.Component _parent)
Affiche le dialogue et le positionne par rapport a _parent.


construitDialogPanel

private com.memoire.bu.BuPanel construitDialogPanel()
Construit le panel de la boite de dialogue.


construireBuButton

private com.memoire.bu.BuButton construireBuButton(java.lang.String _text,
                                                   java.lang.String _action)
Construit un bouton ayant comme label _text et comme "ActionCommand" _action.


construireOk

private void construireOk(com.memoire.bu.BuPanel _p)

construireCancel

private void construireCancel(com.memoire.bu.BuPanel _p)

construireApply

private void construireApply(com.memoire.bu.BuPanel _p)

addRedLabel

protected com.memoire.bu.BuLabel addRedLabel()
ajoute au panel un label dont la couleur de texte est rouge.


addLabel

protected com.memoire.bu.BuLabel addLabel(java.lang.String _l)

addLabelDoubleText

protected com.memoire.bu.BuTextField addLabelDoubleText(java.lang.String _label)

addLabelIntegerText

protected com.memoire.bu.BuTextField addLabelIntegerText(java.lang.String _label)

addDoubleText

protected com.memoire.bu.BuTextField addDoubleText()

addDoubleText

protected com.memoire.bu.BuTextField addDoubleText(double _d)

addIntegerText

protected com.memoire.bu.BuTextField addIntegerText()

addIntegerText

protected com.memoire.bu.BuTextField addIntegerText(int _d)

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent _evt)
Recupere les evt des boutons ok,cancel et apply. bouton OK : valide(), actionApply() et ferme le dialogue (fermerDialog() )
bouton cancel : actionCancel() et ferme le dialogue
bouton cancel : valide(), actionApply()

Specified by:
actionPerformed in interface java.awt.event.ActionListener

fermerDialog

private void fermerDialog()

actualiseAffichage

public void actualiseAffichage()
maj du layout et de la boite de dialogue.


actionApply

protected void actionApply()
Méthode à surcharger : elle est appelee si le bouton APPLY ou OK est active.


actionCancel

protected void actionCancel()
Méthode action pour le bouton CANCEL à surcharger.


windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Description copied from interface: java.awt.event.WindowListener
This method is called when a window is activated. Only Frames and Dialogs can be active, and the active window always contains the component with focus.

Specified by:
windowActivated in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Description copied from interface: java.awt.event.WindowListener
This method is called when the window is closed.

Specified by:
windowClosed in interface java.awt.event.WindowListener

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
Description copied from interface: java.awt.event.WindowListener
This method is called when the user calls the system menu close function, giving the program a chance to cancel the close.

Specified by:
windowClosing in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Description copied from interface: java.awt.event.WindowListener
This method is called when the window is deactivated.

Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Description copied from interface: java.awt.event.WindowListener
This method is called when the window is deiconified.

Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Description copied from interface: java.awt.event.WindowListener
This method is called when the window is iconified.

Specified by:
windowIconified in interface java.awt.event.WindowListener

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Description copied from interface: java.awt.event.WindowListener
This method is called when the window is made visible.

Specified by:
windowOpened in interface java.awt.event.WindowListener