POGO Java Program


pogo.appli
Class PogoAppli

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--java.awt.Window
                    |
                    +--java.awt.Frame
                          |
                          +--javax.swing.JFrame
                                |
                                +--pogo.appli.PogoAppli

public class PogoAppli
extends javax.swing.JFrame
implements PogoAppliDefs, PogoDefs

This is class managing the main window for the POGO (Program Obviously used to Generate tango Object) application.

See Also:
Tango Pages, 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
private  javax.swing.JMenuItem aboutMenuItem
           
private  javax.swing.JFileChooser chooser
          File Chooser Object used in file menu.
private  javax.swing.JMenuItem contentsMenuItem
           
private  javax.swing.JMenuItem copyMenuItem
           
private  javax.swing.JRadioButton cppBtn
           
private  javax.swing.JMenuItem cutMenuItem
           
private  javax.swing.JMenuItem deleteMenuItem
           
private  javax.swing.JMenu editMenu
           
private  javax.swing.JMenuItem exitMenuItem
           
private  javax.swing.JMenu fileMenu
           
private  javax.swing.JMenuItem geneDocBtn
           
private  javax.swing.JMenuItem geneSrcBtn
           
private  javax.swing.JMenu helpMenu
           
private  java.lang.String homeDir
          Director to start file selection.
private  javax.swing.JMenuItem importMenuItem
           
private  javax.swing.JRadioButton javaBtn
           
private  javax.swing.JLabel jLabel1
           
private  javax.swing.JMenuItem jMenuItem1
           
private  javax.swing.JPanel jPanel1
           
private  javax.swing.JScrollPane jScrollPane1
           
private  javax.swing.JSeparator jSeparator1
           
private  javax.swing.JSeparator jSeparator2
           
private  javax.swing.JSeparator jSeparator3
           
private  javax.swing.JSeparator jSeparator4
           
private  javax.swing.JLabel leftBtnLabel
           
private  javax.swing.JMenuBar menuBar
           
private  javax.swing.JPanel mousePanel
           
private  javax.swing.JMenuItem moveDownItem
           
private  javax.swing.JMenuItem moveUpItem
           
private  javax.swing.JMenuItem newMenuItem
           
private  javax.swing.JMenuItem openMenuItem
           
private static java.lang.String[] palette
          Label for Palette menu items.
private  javax.swing.JMenu paletteMenu
           
private  javax.swing.JMenuItem pasteMenuItem
           
private  PogoClass pogo
          Pogo object definition (used to define project and generate source file).
private  javax.swing.JMenu prefMenu
           
private static java.lang.String rcsString
          Initialized by rcs unix utility and used to display title.
private  javax.swing.JLabel rightBtnLabel
           
private  javax.swing.JPanel southPanel
           
private  PogoTree tree
          JTree used to display PogoClass object.
(package private)  javax.swing.JLabel versionLabel
           
 
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
 
Fields inherited from interface pogo.appli.PogoAppliDefs
ATTRIBUTES, BTN1, BTN2, BTN3, COLLECTION, COMMANDS, FILE_SAVE, GENE_DOC, GENE_SRC, helpAbout, helpContents, IMPORT_FILE, LEAF_ITEM, OPEN_FILE, PALETTE_CREATE_ATTR, PALETTE_CREATE_CMD, PALETTE_CREATE_PROP, PALETTE_CREATE_STATE, PALETTE_EDIT_CLASS, PROPERTIES, RET_CANCEL, RET_ERROR, RET_OK, STATES, TangoTypesArray, TREE_ROOT
 
Fields inherited from interface pogo.gene.PogoDefs
ALREADY_OVERRIDING, ATTR_IMAGE, ATTR_READ, ATTR_READ_WITH_WRITE, ATTR_READ_WRITE, ATTR_SCALAR, ATTR_SPECTRUM, ATTR_WRITE, AttrDataArray, AttrRWtypeArray, AttrTypeArray, authorRes, classDescRes, cppAddAttrib, cppAddCommands, cppExtention, cppFile, cppLang, dataCommands, dataExtention, dataFile, dataStartCmd, dataStartStates, endGeneTag, errDetected, javaAddAttrib, javaAddCommands, javaExtention, javaFile, javaLang, languageRes, NEW_STR, NOT_OVERRIDE, outputFiles, OVERRIDE, pageTitleRes, pogoLang, projectTitleRes, readAttrProto1, readAttrProto2, readAttrProto3, readFile, revisionRes, startGeneTag, STATE, statesDescRes, STATUS, Tango_ALARM, Tango_CLOSE, Tango_CONST_DEV_STRING, Tango_DISABLE, Tango_EXTRACT, Tango_FAULT, Tango_INSERT, Tango_MOVING, Tango_OFF, Tango_ON, Tango_OPEN, Tango_RUNNING, Tango_STANDBY, Tango_TYPE_UNKNOWN, Tango_UNKNOWN, Tango_WARMUP, TangoStatesArray, templateBlock, templateClass, templateClassCmd, templateCmd, templateExecuteCmd, templateFile, writeAttrProto, writeFile
 
Constructor Summary
PogoAppli()
          Constructor for PogoAppli object.
 
Method Summary
private  void buildPogoFromFile(int action)
           
private  void copyMenuItemActionPerformed(java.awt.event.ActionEvent evt)
           
private  void customMenu()
          Create the Palette menu item and add accelerators on other menu items.
private  void cutMenuItemActionPerformed(java.awt.event.ActionEvent evt)
           
private  void deleteMenuItemActionPerformed(java.awt.event.ActionEvent evt)
          Called on delete menu item cliked.
private  void editAP(javax.swing.event.MenuEvent evt)
          Called on Edit menu buttoncliked.
private  void exitForm(java.awt.event.WindowEvent evt)
          Called on Exit form button cliked.
private  void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt)
          Called on Exit item menu cliked.
private  void genePrefActionPerformed(java.awt.event.ActionEvent evt)
          Called on Generation Preferences button.
private  void generateAP(java.awt.event.ActionEvent evt)
          Called on Generate item menu cliked.
private  void generateSource(int item)
          Generate source files.
private  int getLanguage()
          Set the language PogoClass field in compatibility with the toggle button .
private  void helpAP(java.awt.event.ActionEvent evt)
          Called on one item of help menu cliked.
private  void importMenuItemActionPerformed(java.awt.event.ActionEvent evt)
           
private  void initComponents()
          This method is called from within the constructor to initialize the form.
private  void languageBtnAP(java.awt.event.ActionEvent evt)
          Called on one of the language toggle buttons is clicked.
static void main(java.lang.String[] args)
           
private  void moveActionPerformed(java.awt.event.ActionEvent evt)
          Called on Move up or down button.
private  void newMenuItemActionPerformed(java.awt.event.ActionEvent evt)
          Called on New item menu cliked.
private  void openMenuItemActionPerformed(java.awt.event.ActionEvent evt)
          Called on Open file item menu cliked.
private  void paletteItemAP(java.awt.event.ActionEvent evt)
          Palette menu item Action Performed method.
private  void pasteMenuItemActionPerformed(java.awt.event.ActionEvent evt)
           
private  void readSourceFile(java.lang.String filename, int action)
          Read the input source file to initialize PogoClass object.
private  void resetLanguage()
           
private  void setLanguage()
          Set the language toggle button in compatibility with the PogoClass field.
private  void setPogoDefined(boolean state)
          Set available or not menu items or buttons if PogoClas is initialized, not initialized or reseted.
private  void tracePogo()
          Dump the pogo objetc.
 
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

rcsString

private static java.lang.String rcsString
Initialized by rcs unix utility and used to display title.
See Also:
RcsId

tree

private PogoTree tree
JTree used to display PogoClass object.

pogo

private PogoClass pogo
Pogo object definition (used to define project and generate source file).

homeDir

private java.lang.String homeDir
Director to start file selection. Could be set with 'HOME_GENE' property.

chooser

private javax.swing.JFileChooser chooser
File Chooser Object used in file menu.

palette

private static java.lang.String[] palette
Label for Palette menu items.

versionLabel

javax.swing.JLabel versionLabel

menuBar

private javax.swing.JMenuBar menuBar

fileMenu

private javax.swing.JMenu fileMenu

newMenuItem

private javax.swing.JMenuItem newMenuItem

openMenuItem

private javax.swing.JMenuItem openMenuItem

importMenuItem

private javax.swing.JMenuItem importMenuItem

jSeparator1

private javax.swing.JSeparator jSeparator1

geneSrcBtn

private javax.swing.JMenuItem geneSrcBtn

geneDocBtn

private javax.swing.JMenuItem geneDocBtn

jSeparator2

private javax.swing.JSeparator jSeparator2

exitMenuItem

private javax.swing.JMenuItem exitMenuItem

editMenu

private javax.swing.JMenu editMenu

cutMenuItem

private javax.swing.JMenuItem cutMenuItem

copyMenuItem

private javax.swing.JMenuItem copyMenuItem

pasteMenuItem

private javax.swing.JMenuItem pasteMenuItem

jSeparator3

private javax.swing.JSeparator jSeparator3

deleteMenuItem

private javax.swing.JMenuItem deleteMenuItem

moveUpItem

private javax.swing.JMenuItem moveUpItem

moveDownItem

private javax.swing.JMenuItem moveDownItem

paletteMenu

private javax.swing.JMenu paletteMenu

prefMenu

private javax.swing.JMenu prefMenu

jMenuItem1

private javax.swing.JMenuItem jMenuItem1

helpMenu

private javax.swing.JMenu helpMenu

contentsMenuItem

private javax.swing.JMenuItem contentsMenuItem

jSeparator4

private javax.swing.JSeparator jSeparator4

aboutMenuItem

private javax.swing.JMenuItem aboutMenuItem

jScrollPane1

private javax.swing.JScrollPane jScrollPane1

southPanel

private javax.swing.JPanel southPanel

mousePanel

private javax.swing.JPanel mousePanel

leftBtnLabel

private javax.swing.JLabel leftBtnLabel

rightBtnLabel

private javax.swing.JLabel rightBtnLabel

jPanel1

private javax.swing.JPanel jPanel1

jLabel1

private javax.swing.JLabel jLabel1

cppBtn

private javax.swing.JRadioButton cppBtn

javaBtn

private javax.swing.JRadioButton javaBtn
Constructor Detail

PogoAppli

public PogoAppli()
Constructor for PogoAppli object. Initialize JForm. And initialize some little things.
Method Detail

initComponents

private void initComponents()
This method is called from within the constructor to initialize the form. WARNING: Do NOT modify this code. The content of this method is always regenerated by the FormEditor.

pasteMenuItemActionPerformed

private void pasteMenuItemActionPerformed(java.awt.event.ActionEvent evt)

copyMenuItemActionPerformed

private void copyMenuItemActionPerformed(java.awt.event.ActionEvent evt)

cutMenuItemActionPerformed

private void cutMenuItemActionPerformed(java.awt.event.ActionEvent evt)

moveActionPerformed

private void moveActionPerformed(java.awt.event.ActionEvent evt)
Called on Move up or down button. Move up or down the selected item.

genePrefActionPerformed

private void genePrefActionPerformed(java.awt.event.ActionEvent evt)
Called on Generation Preferences button. Open the dialog object to manage preferences and set fields.

editAP

private void editAP(javax.swing.event.MenuEvent evt)
Called on Edit menu buttoncliked. Check if a leaf is selected or not. And then enable or not the buttons.

helpAP

private void helpAP(java.awt.event.ActionEvent evt)
Called on one item of help menu cliked.

newMenuItemActionPerformed

private void newMenuItemActionPerformed(java.awt.event.ActionEvent evt)
Called on New item menu cliked.

generateAP

private void generateAP(java.awt.event.ActionEvent evt)
Called on Generate item menu cliked.

languageBtnAP

private void languageBtnAP(java.awt.event.ActionEvent evt)
Called on one of the language toggle buttons is clicked.

generateSource

private void generateSource(int item)
Generate source files. Buid a PogoClass from the interface JTree, get the output langage to generate and call the popo.gene.PogoGene Class to generate source files.
Parameters:
item - FILE_SAVE to save in .pogo file or GENE_SRC to generate Cpp or Java source files.
See Also:
PogoGene Class

customMenu

private void customMenu()
Create the Palette menu item and add accelerators on other menu items.

setLanguage

private void setLanguage()
Set the language toggle button in compatibility with the PogoClass field.

resetLanguage

private void resetLanguage()

getLanguage

private int getLanguage()
                 throws PogoException
Set the language PogoClass field in compatibility with the toggle button .

deleteMenuItemActionPerformed

private void deleteMenuItemActionPerformed(java.awt.event.ActionEvent evt)
Called on delete menu item cliked.

tracePogo

private void tracePogo()
Dump the pogo objetc.

readSourceFile

private void readSourceFile(java.lang.String filename,
                            int action)
Read the input source file to initialize PogoClass object. And built a JTree to display this object.
Parameters:
filename - Source file to be read.
action - open TANGO file or Import TACO file.

openMenuItemActionPerformed

private void openMenuItemActionPerformed(java.awt.event.ActionEvent evt)
Called on Open file item menu cliked.

importMenuItemActionPerformed

private void importMenuItemActionPerformed(java.awt.event.ActionEvent evt)

buildPogoFromFile

private void buildPogoFromFile(int action)

exitMenuItemActionPerformed

private void exitMenuItemActionPerformed(java.awt.event.ActionEvent evt)
Called on Exit item menu cliked.

exitForm

private void exitForm(java.awt.event.WindowEvent evt)
Called on Exit form button cliked.

paletteItemAP

private void paletteItemAP(java.awt.event.ActionEvent evt)
Palette menu item Action Performed method. Call the apropriate method in case of item clicked.
Parameters:
evt - Action Event .

setPogoDefined

private void setPogoDefined(boolean state)
Set available or not menu items or buttons if PogoClas is initialized, not initialized or reseted.
Parameters:
state - true if initialized.

main

public static void main(java.lang.String[] args)

POGO Java Program