wxtgui
Class siteFrame

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JInternalFrame
                  extended bywxtgui.siteFrame
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.image.ImageObserver, java.awt.MenuContainer, javax.swing.RootPaneContainer, java.io.Serializable, javax.swing.WindowConstants

public class siteFrame
extends javax.swing.JInternalFrame

siteFrame handles all actions related to a script associated to this frame. The script is only considered as text as seen from the siteFrame. The siteFrame owns a scripthandler-object that looks upon the script as an XML-structure

See Also:
Serialized Form

Nested Class Summary
protected  class siteFrame.simpleInternalFrameListener
          Listening to events in the frame
 
Nested classes inherited from class javax.swing.JInternalFrame
javax.swing.JInternalFrame.AccessibleJInternalFrame, javax.swing.JInternalFrame.JDesktopIcon
 
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
static int BUILD_ALL
           
static int BUILD_SELECTED
           
static int BUILD_UPDATED
           
static int CONTROL_LINKS
           
protected  java.lang.String m_filePath
          the scripts location
protected  boolean m_isChanged
          edited since last parse
protected  boolean m_isDirty
           
protected  boolean m_isSuccessfullyParsed
          last parse went well
protected  long m_lastModificationTime
          last saved/opened/reload
protected  mainFrame m_main
          the main frame of the application
protected  javax.swing.DefaultListModel m_pageListModel
          page list as displayed in jListPages
protected  reporter m_reporter
           
protected  scripthandler m_theScriptHandler
          the scripthandler object that will parse script and administrate it This sis the link from the GUI to the main functionality
protected  java.net.URI m_theUri
           
static int PARSE
           
 
Fields inherited from class javax.swing.JInternalFrame
closable, CONTENT_PANE_PROPERTY, desktopIcon, FRAME_ICON_PROPERTY, frameIcon, GLASS_PANE_PROPERTY, iconable, IS_CLOSED_PROPERTY, IS_ICON_PROPERTY, IS_MAXIMUM_PROPERTY, IS_SELECTED_PROPERTY, isClosed, isIcon, isMaximum, isSelected, LAYERED_PANE_PROPERTY, maximizable, MENU_BAR_PROPERTY, resizable, ROOT_PANE_PROPERTY, rootPane, rootPaneCheckingEnabled, title, TITLE_PROPERTY
 
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.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface javax.swing.WindowConstants
DISPOSE_ON_CLOSE, DO_NOTHING_ON_CLOSE, EXIT_ON_CLOSE, HIDE_ON_CLOSE
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
siteFrame(mainFrame main, int layoutIndex)
          Creates new form siteFrame
 
Method Summary
 void arrangeComponents(int layoutMode)
          (Re)arrange componentlayout
 void clearPageList()
          Clear the content in pagelist
 void clearReportField()
          Clear the report window
 void conditionalReload()
          Reload if scriptfile has been chenged by another application since we did marked our modification time
 boolean doForcedBuild()
          Will make a complete build of all pages in the actual script
 void doLinkControl()
          Control links
 boolean doLoad()
          Load the script
 boolean doParse()
          Will attempt to make a new scriptHandler.
 boolean doSave()
          Save the script
 boolean doSelectedForcedBuild()
          Build all pages that has been selected by user in the pagelist.
 boolean doUpdateBuild()
          Build all pages that has a component that have been modified since last build
 boolean doValidateScript(java.net.URI schemaURI)
          Will attempt to validate the script against current validator Scheme (URI)
 boolean getChanged()
          Retrieve status of change
 boolean getDirty()
          Finds out if the script has been changed since save/load/reload
 mainFrame getMain()
          get the main frame of the app
 long getModifiedTime()
          Get time when modification whwre set in this programinstance
 boolean getParseSuccess()
          Get the outcome of last parse, as we have set it
 java.lang.String getScript()
          Get current script
 XMLEditorDocument getScriptDocument()
          Get the document that hold the script
 JXMLEditor getScriptEditor()
          Get the editor that hold the script
 java.lang.String getScriptPath()
          Get the path to the script
 java.net.URI getScriptPathAsURI()
          Get the URI to the script
 void hideProgressBar()
          Turn off the progressbar
 void initComponents()
          This method is called from within the constructor to initialize the form.
 boolean isBusy()
          Find out if this siteFrame is busy
 void setChanged(boolean b)
          Make a note that the script has been changed
 void setDirty(boolean b)
          Mark the script dirty
 void setModifiedTime(long t)
          Mark current script as modified at this time
 void setParseSuccess(boolean b)
          Mark success or not for last parse
 void setScript(java.lang.String s)
          Set a new script to this siteFrame
 void setScriptPath(java.lang.String filename)
          Set the path to the script
 javax.swing.JProgressBar showProgressBar()
          Turn on the progressbar and return it
 boolean someSelected()
          Investigates if user has selected any pages in page list
 void startJob(int job)
           
 
Methods inherited from class javax.swing.JInternalFrame
addImpl, addInternalFrameListener, createRootPane, dispose, doDefaultCloseAction, fireInternalFrameEvent, getAccessibleContext, getContentPane, getDefaultCloseOperation, getDesktopIcon, getDesktopPane, getFocusCycleRootAncestor, getFocusOwner, getFrameIcon, getGlassPane, getInternalFrameListeners, getJMenuBar, getLayer, getLayeredPane, getMenuBar, getMostRecentFocusOwner, getNormalBounds, getRootPane, getTitle, getUI, getUIClassID, getWarningString, hide, isClosable, isClosed, isFocusCycleRoot, isIcon, isIconifiable, isMaximizable, isMaximum, isResizable, isRootPaneCheckingEnabled, isSelected, moveToBack, moveToFront, pack, paintComponent, paramString, remove, removeInternalFrameListener, reshape, restoreSubcomponentFocus, setClosable, setClosed, setContentPane, setDefaultCloseOperation, setDesktopIcon, setFocusCycleRoot, setFrameIcon, setGlassPane, setIcon, setIconifiable, setJMenuBar, setLayer, setLayer, setLayeredPane, setLayout, setMaximizable, setMaximum, setMenuBar, setNormalBounds, setResizable, setRootPane, setRootPaneCheckingEnabled, setSelected, setTitle, setUI, show, toBack, toFront, 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, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getWidth, getVisibleRect, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, 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, 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, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, removeAll, removeContainerListener, setFocusTraversalKeys, setFocusTraversalPolicy, 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, 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, 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, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PARSE

public static final int PARSE
See Also:
Constant Field Values

BUILD_ALL

public static final int BUILD_ALL
See Also:
Constant Field Values

BUILD_SELECTED

public static final int BUILD_SELECTED
See Also:
Constant Field Values

BUILD_UPDATED

public static final int BUILD_UPDATED
See Also:
Constant Field Values

CONTROL_LINKS

public static final int CONTROL_LINKS
See Also:
Constant Field Values

m_isDirty

protected boolean m_isDirty

m_isChanged

protected boolean m_isChanged
edited since last parse


m_isSuccessfullyParsed

protected boolean m_isSuccessfullyParsed
last parse went well


m_filePath

protected java.lang.String m_filePath
the scripts location


m_theUri

protected java.net.URI m_theUri

m_lastModificationTime

protected long m_lastModificationTime
last saved/opened/reload


m_theScriptHandler

protected scripthandler m_theScriptHandler
the scripthandler object that will parse script and administrate it This sis the link from the GUI to the main functionality


m_main

protected mainFrame m_main
the main frame of the application


m_pageListModel

protected javax.swing.DefaultListModel m_pageListModel
page list as displayed in jListPages


m_reporter

protected reporter m_reporter
Constructor Detail

siteFrame

public siteFrame(mainFrame main,
                 int layoutIndex)
Creates new form siteFrame

Parameters:
layoutIndex - How the frame will lay out script, report and pagelist
main - The main frame of the app
Method Detail

initComponents

public void initComponents()
This method is called from within the constructor to initialize the form.


startJob

public void startJob(int job)

isBusy

public boolean isBusy()
Find out if this siteFrame is busy


showProgressBar

public javax.swing.JProgressBar showProgressBar()
Turn on the progressbar and return it

Returns:
The progress bar

hideProgressBar

public void hideProgressBar()
Turn off the progressbar


arrangeComponents

public void arrangeComponents(int layoutMode)
(Re)arrange componentlayout

Parameters:
layoutMode - An index indicating the layout

someSelected

public boolean someSelected()
Investigates if user has selected any pages in page list

Returns:
true if at least one page is selcted, false otherwise

getScriptDocument

public XMLEditorDocument getScriptDocument()
Get the document that hold the script

Returns:
the XMLEditorDocument

getScriptEditor

public JXMLEditor getScriptEditor()
Get the editor that hold the script

Returns:
the jScriptEditor

setScript

public void setScript(java.lang.String s)
Set a new script to this siteFrame

Parameters:
s - The new script

getScript

public java.lang.String getScript()
Get current script

Returns:
The current script as text

setScriptPath

public void setScriptPath(java.lang.String filename)
Set the path to the script

Parameters:
filename - The path to the script

getScriptPath

public java.lang.String getScriptPath()
Get the path to the script

Returns:
The path to the script

getScriptPathAsURI

public java.net.URI getScriptPathAsURI()
Get the URI to the script

Returns:
The path to the script

setModifiedTime

public void setModifiedTime(long t)
Mark current script as modified at this time

Parameters:
t - Current time in milliseconds

getModifiedTime

public long getModifiedTime()
Get time when modification whwre set in this programinstance

Returns:
Point in time, in milliseconds, for last modification

setChanged

public void setChanged(boolean b)
Make a note that the script has been changed

Parameters:
b - mark attribute: m_isChanged

getChanged

public boolean getChanged()
Retrieve status of change

Returns:
the value of m_isChanged

getDirty

public boolean getDirty()
Finds out if the script has been changed since save/load/reload

Returns:
true if script has been modified, false otherwise

clearPageList

public void clearPageList()
Clear the content in pagelist


clearReportField

public void clearReportField()
Clear the report window


setDirty

public void setDirty(boolean b)
Mark the script dirty

Parameters:
b - Status we want to mark

setParseSuccess

public void setParseSuccess(boolean b)
Mark success or not for last parse

Parameters:
b - The status we want to set to m_isSuccessfullyParsed

getParseSuccess

public boolean getParseSuccess()
Get the outcome of last parse, as we have set it

Returns:
The content of field: m_isSuccessfullyParsed

getMain

public mainFrame getMain()
get the main frame of the app

Returns:
The main frame of the app

doSave

public boolean doSave()
Save the script

Returns:
true if file is ok, false otherwise

doLoad

public boolean doLoad()
Load the script

Returns:
true if script is loaded, false otherwise

conditionalReload

public void conditionalReload()
Reload if scriptfile has been chenged by another application since we did marked our modification time


doValidateScript

public boolean doValidateScript(java.net.URI schemaURI)
Will attempt to validate the script against current validator Scheme (URI)

Parameters:
schemaURI - The location of the schema to use
Returns:
false if validation is terminated by a fatal error, true else

doParse

public boolean doParse()
Will attempt to make a new scriptHandler. Fails if script is illformed.

Returns:
true if scripthandler parsed the script successfully, false otherwise

doForcedBuild

public boolean doForcedBuild()
Will make a complete build of all pages in the actual script

Returns:
true if we have succeded in general, false otherwise. Failing to build some pages does not automatically produce a false result

doSelectedForcedBuild

public boolean doSelectedForcedBuild()
Build all pages that has been selected by user in the pagelist.

Returns:
true if we have succeded in general, false otherwise. Failing to build some pages does not automatically produce a false result

doLinkControl

public void doLinkControl()
Control links


doUpdateBuild

public boolean doUpdateBuild()
Build all pages that has a component that have been modified since last build

Returns:
true if we have succeded in general, false otherwise. Failing to build some pages does not automatically produce a false result