SOMA.gui
Class PanMappe

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JTabbedPane
                  extended bySOMA.gui.PanMappe
All Implemented Interfaces:
javax.accessibility.Accessible, AnagrafeListener, javax.swing.event.ChangeListener, java.util.EventListener, java.awt.image.ImageObserver, LinguaListener, java.awt.MenuContainer, java.io.Serializable, javax.swing.SwingConstants

public class PanMappe
extends javax.swing.JTabbedPane
implements LinguaListener, AnagrafeListener, javax.swing.event.ChangeListener

See Also:
Serialized Form

Nested Class Summary
protected  class PanMappe.RendererConOmarini
          CLASSE INTERNA PER IL RENDERING DELL'ALBERO: icona a seconda di place o dominio!
 
Nested classes inherited from class javax.swing.JTabbedPane
javax.swing.JTabbedPane.AccessibleJTabbedPane, javax.swing.JTabbedPane.ModelListener
 
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.JTree[] albero
           
protected  Anagrafe anagrafe
          L'oggetto Anagrafe (passato al costruttore) a cui chiedere i dati sui Place.
protected  javax.swing.event.TreeSelectionListener ascoltatore
          Per salvarsi i parametri passati al costruttore.
protected static javax.swing.ImageIcon IMG_ICO_PLACEVARI
           
protected static javax.swing.ImageIcon IMG_ICO_PLADEF
          ICONE CARICATE UNA VOLTA SOLA ALLA CREAZIONE DELLA CLASSE!
protected static javax.swing.ImageIcon IMG_ICO_PLADEFGRUP
           
protected static javax.swing.ImageIcon IMG_ICO_PLANOR
           
protected static javax.swing.ImageIcon IMG_ICO_TAB_APPART
           
protected static javax.swing.ImageIcon IMG_ICO_TAB_DOMII
           
protected static javax.swing.ImageIcon IMG_ICO_TAB_GERDNS
           
protected static javax.swing.ImageIcon IMG_ICO_TAB_TUTTI
           
protected static int MAX_PAN
          Per salvarsi gli oggetti inseriti nei pannelli.
protected  javax.swing.tree.DefaultTreeModel[] modello
           
 
Fields inherited from class javax.swing.JTabbedPane
changeEvent, changeListener, model, SCROLL_TAB_LAYOUT, tabPlacement, WRAP_TAB_LAYOUT
 
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 javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
PanMappe(javax.swing.event.TreeSelectionListener ascoltatoreSelezione, Anagrafe anagrafe)
          Costruisce un "pannello di mappe".
 
Method Summary
 void aggiornaMappe()
          Esegue l'aggiornamento di tutte le mappe (gli alberi) ricostruendoli daccapo, cioè richiedendone la costruzione all'oggetto Anagrafe.
 void anagrafeCambiata()
          METODO RICHIESTO DALL'INTERFACCIA "AnagrafeListener".
protected  javax.swing.JScrollPane creaMioAlbero(javax.swing.JTree albero, int numPannello)
          Metodo Interno.
 void distruggimi()
          Permette la distruzione del pannello.
protected  void espandiTuttoLAbero(javax.swing.JTree albero, javax.swing.tree.DefaultMutableTreeNode nodoAtt)
          Metodo interno; espande l'intero albero in modo che tutti i nodi siano visibili.
protected  void impostaFrasi()
          Definisce/modifica tutte le frasi mostrate a video (nella GUI).
 void linguaCambiata()
          METODO RICHIESTO DALL'INTERFACCIA "LinguaListener".
 void stateChanged(javax.swing.event.ChangeEvent e)
          METODO RICHIESTO DALL'INTERFACCIA "ChangeListener".
 
Methods inherited from class javax.swing.JTabbedPane
add, add, add, add, add, addChangeListener, addTab, addTab, addTab, createChangeListener, fireStateChanged, getAccessibleContext, getBackgroundAt, getBoundsAt, getChangeListeners, getComponentAt, getDisabledIconAt, getDisplayedMnemonicIndexAt, getForegroundAt, getIconAt, getMnemonicAt, getModel, getSelectedComponent, getSelectedIndex, getTabCount, getTabLayoutPolicy, getTabPlacement, getTabRunCount, getTitleAt, getToolTipText, getToolTipTextAt, getUI, getUIClassID, indexAtLocation, indexOfComponent, indexOfTab, indexOfTab, insertTab, isEnabledAt, paramString, remove, remove, removeAll, removeChangeListener, removeTabAt, setBackgroundAt, setComponentAt, setDisabledIconAt, setDisplayedMnemonicIndexAt, setEnabledAt, setForegroundAt, setIconAt, setMnemonicAt, setModel, setSelectedComponent, setSelectedIndex, setTabLayoutPolicy, setTabPlacement, setTitleAt, setToolTipTextAt, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, 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, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, 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
addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, 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, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, 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, 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, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

IMG_ICO_PLADEF

protected static final javax.swing.ImageIcon IMG_ICO_PLADEF
ICONE CARICATE UNA VOLTA SOLA ALLA CREAZIONE DELLA CLASSE!


IMG_ICO_PLANOR

protected static final javax.swing.ImageIcon IMG_ICO_PLANOR

IMG_ICO_PLACEVARI

protected static final javax.swing.ImageIcon IMG_ICO_PLACEVARI

IMG_ICO_PLADEFGRUP

protected static final javax.swing.ImageIcon IMG_ICO_PLADEFGRUP

IMG_ICO_TAB_APPART

protected static final javax.swing.ImageIcon IMG_ICO_TAB_APPART

IMG_ICO_TAB_GERDNS

protected static final javax.swing.ImageIcon IMG_ICO_TAB_GERDNS

IMG_ICO_TAB_DOMII

protected static final javax.swing.ImageIcon IMG_ICO_TAB_DOMII

IMG_ICO_TAB_TUTTI

protected static final javax.swing.ImageIcon IMG_ICO_TAB_TUTTI

ascoltatore

protected javax.swing.event.TreeSelectionListener ascoltatore
Per salvarsi i parametri passati al costruttore.


anagrafe

protected Anagrafe anagrafe
L'oggetto Anagrafe (passato al costruttore) a cui chiedere i dati sui Place.


MAX_PAN

protected static final int MAX_PAN
Per salvarsi gli oggetti inseriti nei pannelli.

See Also:
Constant Field Values

albero

protected javax.swing.JTree[] albero

modello

protected javax.swing.tree.DefaultTreeModel[] modello
Constructor Detail

PanMappe

public PanMappe(javax.swing.event.TreeSelectionListener ascoltatoreSelezione,
                Anagrafe anagrafe)
Costruisce un "pannello di mappe". L'oggetto "TreeSelectionListener" passato verrà avvisato ogniqualvolta l'utente seleziona sul pannello una rappresentazione di un place. Il pannello mette a disposizione alcuni differenti tipi di "visioni" del sistema; sono tutte strutture che vengono richiesti all'oggetto Anagrafe. Il TreeSelectionListener passato deve scrivere un suo metodo "valueChanged" con cui accedere al nodo dell'albero e prelevare il PlaceID contenuto nel nodo selezionato da utente.

Method Detail

impostaFrasi

protected void impostaFrasi()
Definisce/modifica tutte le frasi mostrate a video (nella GUI).


creaMioAlbero

protected javax.swing.JScrollPane creaMioAlbero(javax.swing.JTree albero,
                                                int numPannello)
Metodo Interno. Dato un JTree ne definisce la rappresentazione (anche in base al numero del pannello in cui è inserito). Nota: verrà imposta la per selezione singola, le icone dei vari nodi, e viene reso un JScrollPane che conterrà tale albero.


distruggimi

public void distruggimi()
Permette la distruzione del pannello. Serve per rimuovere il pannello dai "listener" del cambio di lingua.


aggiornaMappe

public void aggiornaMappe()
Esegue l'aggiornamento di tutte le mappe (gli alberi) ricostruendoli daccapo, cioè richiedendone la costruzione all'oggetto Anagrafe. E` invocato ogni volta che si verifica una "modifica d'anagrafe" (in modo da riaggiornare gli alberi) dal metodo "anagrafeCambiata" di questo stesso pannello (che si è registrato per ascoltare le modifiche d'anagrafe).


espandiTuttoLAbero

protected void espandiTuttoLAbero(javax.swing.JTree albero,
                                  javax.swing.tree.DefaultMutableTreeNode nodoAtt)
Metodo interno; espande l'intero albero in modo che tutti i nodi siano visibili. E` richiesto sia l'albero (JTree) sia il nodo iniziale da cui espandere (DefaultMutableTreeNode), che in genere è la radice.


linguaCambiata

public void linguaCambiata()
METODO RICHIESTO DALL'INTERFACCIA "LinguaListener". Viene invocato automaticamente quando qualcuno invoca la "Lingua.defLingua()" Ovviamente chiama "impostaFrasi()".

Specified by:
linguaCambiata in interface LinguaListener

anagrafeCambiata

public void anagrafeCambiata()
METODO RICHIESTO DALL'INTERFACCIA "AnagrafeListener". Viene invocato automaticamente quando qualcuno invoca la "anagrafe.battezzaPlace()" Ovviamente chiama "aggiornaMappe()".

Specified by:
anagrafeCambiata in interface AnagrafeListener

stateChanged

public void stateChanged(javax.swing.event.ChangeEvent e)
METODO RICHIESTO DALL'INTERFACCIA "ChangeListener". Viene invocato automaticamente quando l'utente cambia il "tabbed-pane" mostrato. Serve per lanciare un "treeSelection" al listener di questo pannello.

Specified by:
stateChanged in interface javax.swing.event.ChangeListener


Copyright © 2004 Luca Foschini