org.w3c.rdfpic.ui
Class SimpleUI

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Frame
                          |
                          +--javax.swing.JFrame
                                |
                                +--org.w3c.rdfpic.ui.SimpleUI

public class SimpleUI
extends javax.swing.JFrame
implements java.awt.event.ActionListener, java.awt.event.WindowListener, java.awt.event.ItemListener, ImgListener, SchemaListener, Checker

A simple UI for RdfPic. It creates a menubar with a '?' (about) 'rdf' and 'image' menus and lets the user use SchemaTabbedPane to edit the rdf in the image. The SchemaTabbedPane is placed next to a preview of the image in a JSplitPane. 'next' 'prev' and 'apply' command are also available in a toolbar initially under the menubar, as well as a language selection box.

See Also:
Serialized Form

Inner classes inherited from class javax.swing.JFrame
javax.swing.JFrame.AccessibleJFrame
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AWTTreeLock
 
Field Summary
(package private)  javax.swing.JMenu aboutMenu
           
(package private)  javax.swing.JButton applyButton
           
(package private)  javax.swing.JMenuItem applyItem
           
(package private)  RdfPicCore core
           
(package private)  SchemaTabbedPane dataPane
           
(package private)  ExtensionFileFilter effJpeg
           
(package private)  ExtensionFileFilter effSchema
           
(package private)  javax.swing.JMenuItem exportRdf
           
(package private)  javax.swing.JMenuItem extractRaw
           
(package private)  javax.swing.JFileChooser fc
           
(package private)  javax.swing.JMenu fileMenu
           
(package private)  boolean ignoreToggle
           
(package private)  javax.swing.JMenu imageMenu
           
(package private)  javax.swing.JMenuItem importRdf
           
(package private)  javax.swing.JMenuItem insertRaw
           
(package private)  javax.swing.JComboBox langsel
           
(package private)  javax.swing.JMenuBar menuBar
           
(package private)  javax.swing.JButton nextButton
           
(package private)  javax.swing.JMenuItem nextItem
           
(package private)  ScaledPhoto photo
           
(package private)  javax.swing.JButton prevButton
           
(package private)  javax.swing.JMenuItem prevItem
           
(package private)  javax.swing.ButtonGroup selectImageGroup
           
(package private)  javax.swing.JRadioButtonMenuItem[] selectImageItems
           
(package private)  javax.swing.JMenu selectImageMenu
           
(package private) static java.lang.String separatorStr
           
(package private) static java.lang.String titleStr
           
(package private)  javax.swing.JCheckBoxMenuItem[] toggleSchemaItem
           
(package private)  javax.swing.JMenu toggleSchemaMenu
           
 
Fields inherited from class javax.swing.JFrame
accessibleContext, defaultCloseOperation, rootPane, rootPaneCheckingEnabled
 
Fields inherited from class java.awt.Frame
base, CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, frameSerializedDataVersion, HAND_CURSOR, icon, ICONIFIED, mbManagement, menuBar, MOVE_CURSOR, N_RESIZE_CURSOR, nameCounter, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, ownedWindows, resizable, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, serialVersionUID, state, SW_RESIZE_CURSOR, TEXT_CURSOR, title, W_RESIZE_CURSOR, WAIT_CURSOR, weakThis
 
Fields inherited from class java.awt.Window
active, base, focusMgr, inputContext, nameCounter, 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
 
Constructor Summary
SimpleUI()
           
 
Method Summary
 void actionPerformed(java.awt.event.ActionEvent e)
           
 void addingSchema()
          Called when a schema is added.
(package private)  void checkEnabledStatus()
           
(package private)  void checkEnabledStatus(int index)
           
 boolean checkInput(java.lang.String msgID, java.lang.String input)
          Must return whether the input is acceptable.
 void disablingSchema(int index)
           
 void enablingSchema(int index)
           
(package private)  void genSelectImageItems()
           
(package private)  void genToggleSchema()
           
 void go(RdfPicCore core)
          Activates the UI
 void hasJumped(java.lang.String errMsg)
          Is called when the load is finished.
 void imgVUpdate()
          Is called when the vector of images has changed.
 void isJumping(int newindex)
          Is called when a load request is put.
 void itemStateChanged(java.awt.event.ItemEvent e)
           
(package private)  void jumpSafe(boolean safe)
           
 void quit()
           
 void windowActivated(java.awt.event.WindowEvent e)
           
 void windowClosed(java.awt.event.WindowEvent e)
           
 void windowClosing(java.awt.event.WindowEvent e)
           
 void windowDeactivated(java.awt.event.WindowEvent e)
           
 void windowDeiconified(java.awt.event.WindowEvent e)
           
 void windowIconified(java.awt.event.WindowEvent e)
           
 void windowOpened(java.awt.event.WindowEvent e)
           
(package private)  void writeEnable(boolean safe)
           
private  void yetTodo(java.lang.String msg)
           
 
Methods inherited from class javax.swing.JFrame
addImpl, createRootPane, createRootPaneException, frameInit, getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getJMenuBar, getLayeredPane, getRootPane, isRootPaneCheckingEnabled, paramString, processKeyEvent, processWindowEvent, remove, setContentPane, setDefaultCloseOperation, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setRootPane, setRootPaneCheckingEnabled, update
 
Methods inherited from class java.awt.Frame
, addNotify, addToFrameList, constructComponentName, finalize, getCursorType, getFrames, getIconImage, getMenuBar, getState, getTitle, initIDs, isResizable, postProcessKeyEvent, readObject, remove, removeFromFrameList, removeNotify, setCursor, setIconImage, setMenuBar, setResizable, setState, setTitle, writeObject
 
Methods inherited from class java.awt.Window
addOwnedWindow, addWindowListener, applyResourceBundle, applyResourceBundle, connectOwnedWindow, dispatchEventImpl, dispose, eventEnabled, getFocusOwner, getInputContext, getLocale, getOwnedWindows, getOwner, getToolkit, getWarningString, hide, isActive, isShowing, nextFocus, ownedInit, pack, postEvent, postWindowEvent, preProcessKeyEvent, processEvent, removeOwnedWindow, removeWindowListener, setCursor, setFocusOwner, setWarningString, show, toBack, toFront, transferFocus
 
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, printHeavyweightComponents, printOneComponent, processContainerEvent, proxyEnableEvents, proxyRequestFocus, remove, removeAll, removeContainerListener, 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, 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

titleStr

static java.lang.String titleStr

fc

javax.swing.JFileChooser fc

effJpeg

ExtensionFileFilter effJpeg

effSchema

ExtensionFileFilter effSchema

applyButton

javax.swing.JButton applyButton

nextButton

javax.swing.JButton nextButton

prevButton

javax.swing.JButton prevButton

langsel

javax.swing.JComboBox langsel

photo

ScaledPhoto photo

dataPane

SchemaTabbedPane dataPane

menuBar

javax.swing.JMenuBar menuBar

fileMenu

javax.swing.JMenu fileMenu

imageMenu

javax.swing.JMenu imageMenu

aboutMenu

javax.swing.JMenu aboutMenu

toggleSchemaMenu

javax.swing.JMenu toggleSchemaMenu

selectImageMenu

javax.swing.JMenu selectImageMenu

applyItem

javax.swing.JMenuItem applyItem

nextItem

javax.swing.JMenuItem nextItem

prevItem

javax.swing.JMenuItem prevItem

extractRaw

javax.swing.JMenuItem extractRaw

insertRaw

javax.swing.JMenuItem insertRaw

importRdf

javax.swing.JMenuItem importRdf

exportRdf

javax.swing.JMenuItem exportRdf

toggleSchemaItem

javax.swing.JCheckBoxMenuItem[] toggleSchemaItem

selectImageGroup

javax.swing.ButtonGroup selectImageGroup

selectImageItems

javax.swing.JRadioButtonMenuItem[] selectImageItems

core

RdfPicCore core

ignoreToggle

boolean ignoreToggle

separatorStr

static final java.lang.String separatorStr
Constructor Detail

SimpleUI

public SimpleUI()
Method Detail

windowActivated

public void windowActivated(java.awt.event.WindowEvent e)
Specified by:
windowActivated in interface java.awt.event.WindowListener

windowDeactivated

public void windowDeactivated(java.awt.event.WindowEvent e)
Specified by:
windowDeactivated in interface java.awt.event.WindowListener

windowIconified

public void windowIconified(java.awt.event.WindowEvent e)
Specified by:
windowIconified in interface java.awt.event.WindowListener

windowDeiconified

public void windowDeiconified(java.awt.event.WindowEvent e)
Specified by:
windowDeiconified in interface java.awt.event.WindowListener

windowOpened

public void windowOpened(java.awt.event.WindowEvent e)
Specified by:
windowOpened in interface java.awt.event.WindowListener

windowClosed

public void windowClosed(java.awt.event.WindowEvent e)
Specified by:
windowClosed in interface java.awt.event.WindowListener

windowClosing

public void windowClosing(java.awt.event.WindowEvent e)
Specified by:
windowClosing in interface java.awt.event.WindowListener

go

public void go(RdfPicCore core)
Activates the UI

checkEnabledStatus

void checkEnabledStatus()

checkEnabledStatus

void checkEnabledStatus(int index)

genToggleSchema

void genToggleSchema()

genSelectImageItems

void genSelectImageItems()

addingSchema

public void addingSchema()
Description copied from interface: SchemaListener
Called when a schema is added.
Specified by:
addingSchema in interface SchemaListener

enablingSchema

public void enablingSchema(int index)
Specified by:
enablingSchema in interface SchemaListener

disablingSchema

public void disablingSchema(int index)
Specified by:
disablingSchema in interface SchemaListener

itemStateChanged

public void itemStateChanged(java.awt.event.ItemEvent e)
Specified by:
itemStateChanged in interface java.awt.event.ItemListener

jumpSafe

void jumpSafe(boolean safe)

writeEnable

void writeEnable(boolean safe)

isJumping

public void isJumping(int newindex)
Description copied from interface: ImgListener
Is called when a load request is put. (not from load-thread).
Specified by:
isJumping in interface ImgListener
Tags copied from interface: ImgListener
Parameters:
newindex - Index of the file being loaded.

imgVUpdate

public void imgVUpdate()
Description copied from interface: ImgListener
Is called when the vector of images has changed. For example the active image has a new index, or an image has been added/removed/rearranged.
Specified by:
imgVUpdate in interface ImgListener

hasJumped

public void hasJumped(java.lang.String errMsg)
Description copied from interface: ImgListener
Is called when the load is finished. (from load-thread).
Specified by:
hasJumped in interface ImgListener
Tags copied from interface: ImgListener
Parameters:
errMsg - null on success, explanation on error.

actionPerformed

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

checkInput

public boolean checkInput(java.lang.String msgID,
                          java.lang.String input)
Description copied from interface: Checker
Must return whether the input is acceptable.
Specified by:
checkInput in interface Checker
Tags copied from interface: Checker
Parameters:
input - The user's input.
msgID - An ID for the message, to allow one checker to check several messages.
Returns:
whether or not the input is acceptable.

quit

public void quit()

yetTodo

private void yetTodo(java.lang.String msg)