ui
Class TabbedPanel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--ui.BasicPanel
                    |
                    +--ui.TabbedPanel
All Implemented Interfaces:
java.awt.event.ActionListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, UiEffects

public class TabbedPanel
extends BasicPanel
implements java.awt.event.ActionListener

See Also:
Serialized Form

Nested Class Summary
 
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
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface ui.UiEffects
CENTER, EMBLOSSED, ENGRAVED, FLAT, JUSTIFY, LEFT, LOWERED, NONE, RAISED, RIGHT, ROUNDED, SHADOW, TEXT_LOWERED, TEXT_NORMAL, TEXT_OUTLINE, TEXT_RAISED, TEXT_SHADOW, TEXT_SUB
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
TabbedPanel(int width, int height)
           
TabbedPanel(int width, int height, java.awt.Image bgImage, boolean tiled, int borderEffects, UiSettings moreSettings)
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void addTab(java.lang.String label, java.lang.String className)
           
 boolean checkAnswer()
           
protected  void createCaption()
           
protected  void createTab(ui.Tab tab, int startX, int len, int startY, int index)
          Ritar upp en flik om så behövs
protected  void drawCaption(java.awt.Graphics g)
          Rita upp flikarna
 java.awt.Dimension getMinimumSize()
          Gets the minumum dimensions for this text field.
 java.awt.Dimension getPreferredSize()
          Gets the preferred size of this text field.
 int getTabHeight()
          Ta reda på höjden på flikarna högst upp i panelen.
 void paint(java.awt.Graphics g)
          Ritar upp panelen.
protected  void refreshInsets()
          Bestämmer avståndet till ev. rubrik samt kanternas storlek Brukar anropas av Paint.
 void removeTabAt(int position)
           
 boolean selectNext()
           
 boolean setSelectedIndex(int index)
           
 void setTabHeight(int tabHeight)
          Ändra höjd på flikarna högst upp i panelen.
 void showHint()
           
 void showSolution()
           
 
Methods inherited from class ui.BasicPanel
drawTextLine, getInsets, insets, isStyleSet, setBackground, setBgImage, setTextShadow, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getListeners, getMaximumSize, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAccessibleContext, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

TabbedPanel

public TabbedPanel(int width,
                   int height)
Parameters:
width - Minsta bredd
height - Minsta höjd (OBS! För innehållet, flikhöjden tillkommer.)

TabbedPanel

public TabbedPanel(int width,
                   int height,
                   java.awt.Image bgImage,
                   boolean tiled,
                   int borderEffects,
                   UiSettings moreSettings)
Parameters:
width - Minsta bredd
height - Minsta höjd (OBS! För innehållet, flikhöjden tillkommer.)
Method Detail

addTab

public void addTab(java.lang.String label,
                   java.lang.String className)

removeTabAt

public void removeTabAt(int position)

setSelectedIndex

public boolean setSelectedIndex(int index)

selectNext

public boolean selectNext()

refreshInsets

protected void refreshInsets()
Bestämmer avståndet till ev. rubrik samt kanternas storlek Brukar anropas av Paint.

Overrides:
refreshInsets in class BasicPanel

drawCaption

protected void drawCaption(java.awt.Graphics g)
Rita upp flikarna

Overrides:
drawCaption in class BasicPanel
Parameters:
g - Den grafiska kontexten att rita på.

createCaption

protected void createCaption()

createTab

protected void createTab(ui.Tab tab,
                         int startX,
                         int len,
                         int startY,
                         int index)
Ritar upp en flik om så behövs


getPreferredSize

public java.awt.Dimension getPreferredSize()
Gets the preferred size of this text field.

Overrides:
getPreferredSize in class java.awt.Container
Returns:
the preferred dimensions for displaying this text field.

getMinimumSize

public java.awt.Dimension getMinimumSize()
Gets the minumum dimensions for this text field.

Overrides:
getMinimumSize in class java.awt.Container
Returns:
the minimum dimensions for displaying this text field.

setTabHeight

public void setTabHeight(int tabHeight)
Ändra höjd på flikarna högst upp i panelen.

Parameters:
tabHeight - Ny flikhöjd.

getTabHeight

public int getTabHeight()
Ta reda på höjden på flikarna högst upp i panelen.

Returns:
Flikhöjden.

paint

public void paint(java.awt.Graphics g)
Description copied from class: BasicPanel
Ritar upp panelen. Inget kommer att ritas om panelen är underdimensionerad, dvs när bredden/höjden är mindre än kantbredden.

Overrides:
paint in class BasicPanel

checkAnswer

public boolean checkAnswer()

showHint

public void showHint()

showSolution

public void showSolution()

actionPerformed

public void actionPerformed(java.awt.event.ActionEvent e)
Specified by:
actionPerformed in interface java.awt.event.ActionListener