Documentation of 'japlot.jaxodraw.JaxoMainPanel' Java class
JaxoMainPanel
japlot.jaxodraw

Class JaxoMainPanel

  • All Implemented Interfaces:
    java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible, javax.swing.RootPaneContainer, javax.swing.WindowConstants


    public class JaxoMainPanel
    extends javax.swing.JFrame
    The main panel: holds the menu bar, the button panel, the flag panel and the canvas. Responsible for the interaction between those components.
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.awt.Window

        java.awt.Window.Type
      • Nested classes/interfaces inherited from class java.awt.Component

        java.awt.Component.BaselineResizeBehavior
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static int BACKGROUND
      Put an object in the background.
      static int BLOB
      Blob (filled ellipse).
      static int BOX
      Box (filled rectangle).
      static int CLEAR
      Clear the current graph.
      static int CLOSE
      Close the current buffer.
      static int COLOR
      Color an object.
      static int COPY
      Copy an object.
      static int DELETE
      Delete an object.
      static int DESCRIBE
      Enter a description of the graph.
      static int DUMMIE
      A dummy variable.
      static int DUMMIE1
      Another dummy.
      static int EDIT
      Edit an object.
      static int EXPORT
      Export the graph.
      static int FARC
      Fermion arc.
      static int FLINE
      Fermion line.
      static int FLOOP
      Fermion loop.
      static int FOREGROUND
      Put an object in the foreground.
      static int GARC
      Ghost arc.
      static int GLARC
      Gluon arc.
      static int GLINE
      Ghost line.
      static int GLLINE
      Gluon line.
      static int GLLOOP
      Gluon loop.
      static int GLOOP
      Ghost loop.
      static int GROUP
      Group objects.
      static int IMPORT
      Import a Latex file.
      static int LATEX
      Latex text.
      static int MOVE
      Move an object.
      static int NEWG
      Start a new graph.
      static int NEWT
      Start a new graph tab.
      static int OPEN
      Open a japlot.jaxodraw file.
      static int OPENDATA
      Open a ROOT/AIDA file.
      static int PACKAGE
      Add a custom Latex package to the Latex output of japlot.jaxodraw.
      static int PARC
      Photon arc.
      static int PASTE
      Paste the most recently selected objects from the clipboard.
      static int PLINE
      Photon line.
      static int PLOOP
      Photon loop.
      static int PREVIEW
      Preview the graph.
      static int PRINT
      Print the graph.
      static int QUIT
      Exit this japlot.jaxodraw session.
      static int REFRESH
      Refresh the screen.
      static int RESIZE
      Resize an object.
      static int SARC
      Scalar arc.
      static int SAVE
      Save a japlot.jaxodraw graph.
      static int SAVE_AS
      Save a japlot.jaxodraw graph in a given file.
      static int SLINE
      Scalar line.
      static int SLOOP
      Scalar loop.
      static int STANDBY
      Default drawing mode: do nothing.
      static int TEXT
      Normal text.
      static int UNDO
      Undo the last operation.
      static int UNGROUP
      Ungroup objects.
      static int VERTEX
      Vertex (black circle).
      static int VERTEXT1
      A vertex type 1 object (a dot).
      static int VERTEXT2
      A vertex type 2 object (a cross with a circle).
      static int VERTEXT3
      A vertex type 3 object (a filled square).
      static int VERTEXT4
      A vertex type 4 object (a cross).
      static int VERTEXT5
      A vertex type 5 object (a triangle).
      static int VERTEXT6
      A vertex type 6 object (a diamond).
      static int ZIGZAG
      ZigZag line.
      static int ZOOM
      Dynamic zoom.
      • Fields inherited from class javax.swing.JFrame

        EXIT_ON_CLOSE
      • Fields inherited from class java.awt.Frame

        CROSSHAIR_CURSOR, DEFAULT_CURSOR, E_RESIZE_CURSOR, HAND_CURSOR, ICONIFIED, MAXIMIZED_BOTH, MAXIMIZED_HORIZ, MAXIMIZED_VERT, MOVE_CURSOR, N_RESIZE_CURSOR, NE_RESIZE_CURSOR, NORMAL, NW_RESIZE_CURSOR, S_RESIZE_CURSOR, SE_RESIZE_CURSOR, SW_RESIZE_CURSOR, TEXT_CURSOR, W_RESIZE_CURSOR, WAIT_CURSOR
      • 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, HIDE_ON_CLOSE
      • Fields inherited from interface java.awt.image.ImageObserver

        ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void actionEvent(int i)
      Called when an action item has been chosen from the menu bar, the button panel or via key shortcuts.
      void antialiasOn(boolean on)
      Switches antialiasing on or off.
      void applyPrefs()
      Applies the preferences.
      void arrow(boolean on)
      Determines whether to draw arrows on lines, arcs and loops.
      void clearData(int padX, int padY)
      Clear the data
      void editEvent(int i)
      Called when an edit item has been chosen from the menu bar, the button panel or via key shortcuts.
      void export(java.lang.String file)
      Fast export of the canvas to an image file (depends on the extension, i.e.
      void exportImage()
      Exports the image to some graphic format using a dialog
      void fileEvent(int i)
      Called when a file item has been chosen from the menu , the tool bar or via key shortcuts.
      void fillBrowser(java.util.Map<java.lang.String,java.lang.Object> map)
      Fill browser.
      JaxoCanvas getCanvas()
      Returns an instance of the canvas.
      JaxoTabbedCanvasPanel getCanvasPanel()
      Returns the particle button panel.
      JaxoGraph getClipboard()
      Returns the current clipboard.
      JaxoEditButtons getEbtPanel()
      Returns the edit button panel.
      JaxoGridButtons getGbtPanel()
      Returns the grid button panel.
      JaxoGraph getGraph()
      Get graph of this canvas
      HPlotJa getJaPlot()
      Get HPlotJa
      JaxoMiscButtons getMbtPanel()
      Returns the miscellaneous button panel.
      int getMode()
      Return the current drawing/editing mode.
      JaxoOptionsMenu getOptMenu()
      Returns the options menu.
      JaxoParticleButtons getPbtPanel()
      Returns the particle button panel.
      int getSizeX()
      Repaints the canvas.
      int getSizeY()
      Repaints the canvas.
      boolean getSnap()
      Returns the current snap mode.
      int getVertexType()
      Returns the current vertex type.
      JaxoZoom getZoom()
      Returns the zoom.
      void gridOn(boolean on)
      Switches the grid on or off.
      void helpEvent() 
      void init(java.lang.String inputFileName, JaxoGraph fGraph)
      The initialisation method of the panel: sets up the menus, the button panels, the flag panel and the canvas.
      boolean isEditMode()
      Determines whether the current mode is an edit mode.
      boolean isMiscMode()
      Determines whether the current mode is a misc mode.
      boolean isParticleMode()
      Determines whether the current mode is a particle mode.
      boolean isWatchMode()
      Indicates whether watch mode is active or not.
      void miscEvent(int i)
      Called when a misc item has been chosen from the button panel.
      void particleEvent(int i)
      Processes the corresponding events whenever a particle button has been pressed.
      void repaintCanvas()
      Repaints the canvas.
      void reset()
      Resets the canvas.
      void resetButtons()
      Sets all the buttons as not pressed and hides the handles.
      void setAxes(int n1, int n2) 
      void setClipboard(JaxoGraph newClipboard)
      Sets the clipboard.
      void setFlagPanelCoordinates(java.lang.String coordinates)
      Sets the coordinates in the flag panel.
      void setFlagPanelFileName(java.lang.String filename)
      Sets the current file being edited in the flag panel.
      void setFlagPanelMode(java.lang.String mode)
      Sets the current drawing/edit mode in the flag panel.
      void setGraph(JaxoGraph graph) 
      void setLanguage(java.lang.String languageString)
      Sets the text and tool tips for all components of the panel (the menus, toolbar, button panels and status bar) in different languages.
      void setMode(int newMode)
      Sets the current drawing/edit mode.
      void setSizeCanvas(int xsize, int ysize)
      set size
      void setSnap(boolean newSnap)
      Sets the snap mode.
      void setVertexType(int type)
      Sets the current type of vertex.
      void setWatchMode(boolean choice)
      Sets the current watch mode.
      void setZoom(JaxoZoom z)
      Sets the zoom.
      void showBrowserbar(boolean show)
      Switches the browser on or off.
      void showEditorbar(boolean show)
      Switches the editor on or off.
      void showStatusbar(boolean show)
      Switches the status bar on or off.
      void showToolbar(boolean show)
      Switches the toolbar on or off.
      void shutdown()
      Clear from all objects and dispose the frame.
      void update()
      Update
      void updateUI() 
      void updateZoom()
      Initializes the zoom: sets the background image, graphics context, image dimensions and canvas dimensions.
      • Methods inherited from class javax.swing.JFrame

        getAccessibleContext, getContentPane, getDefaultCloseOperation, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, isDefaultLookAndFeelDecorated, remove, repaint, setContentPane, setDefaultCloseOperation, setDefaultLookAndFeelDecorated, setGlassPane, setIconImage, setJMenuBar, setLayeredPane, setLayout, setTransferHandler, update
      • Methods inherited from class java.awt.Frame

        addNotify, getCursorType, getExtendedState, getFrames, getIconImage, getMaximizedBounds, getMenuBar, getState, getTitle, isResizable, isUndecorated, remove, removeNotify, setBackground, setCursor, setExtendedState, setMaximizedBounds, setMenuBar, setOpacity, setResizable, setShape, setState, setTitle, setUndecorated
      • Methods inherited from class java.awt.Window

        addPropertyChangeListener, addPropertyChangeListener, addWindowFocusListener, addWindowListener, addWindowStateListener, applyResourceBundle, applyResourceBundle, createBufferStrategy, createBufferStrategy, dispose, getBackground, getBufferStrategy, getFocusableWindowState, getFocusCycleRootAncestor, getFocusOwner, getFocusTraversalKeys, getIconImages, getInputContext, getListeners, getLocale, getModalExclusionType, getMostRecentFocusOwner, getOpacity, getOwnedWindows, getOwner, getOwnerlessWindows, getShape, getToolkit, getType, getWarningString, getWindowFocusListeners, getWindowListeners, getWindows, getWindowStateListeners, hide, isActive, isAlwaysOnTop, isAlwaysOnTopSupported, isAutoRequestFocus, isFocusableWindow, isFocusCycleRoot, isFocused, isLocationByPlatform, isOpaque, isShowing, isValidateRoot, pack, paint, postEvent, removeWindowFocusListener, removeWindowListener, removeWindowStateListener, reshape, setAlwaysOnTop, setAutoRequestFocus, setBounds, setBounds, setCursor, setFocusableWindowState, setFocusCycleRoot, setIconImages, setLocation, setLocation, setLocationByPlatform, setLocationRelativeTo, setMinimumSize, setModalExclusionType, setSize, setSize, setType, setVisible, show, toBack, toFront
      • Methods inherited from class java.awt.Container

        add, add, add, add, add, addContainerListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalPolicy, getInsets, getLayout, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusDownCycle, validate
      • Methods inherited from class java.awt.Component

        action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, prepareImage, prepareImage, printAll, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocusInWindow, resize, resize, revalidate, setComponentOrientation, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setMaximumSize, setName, setPreferredSize, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.awt.MenuContainer

        getFont, postEvent
    • Constructor Detail

      • JaxoMainPanel

        public JaxoMainPanel(HPlotJa japlot)
    • Method Detail

      • getJaPlot

        public HPlotJa getJaPlot()
        Get HPlotJa
      • init

        public final void init(java.lang.String inputFileName,
                               JaxoGraph fGraph)
        The initialisation method of the panel: sets up the menus, the button panels, the flag panel and the canvas. If an input file was given on the command line, opens it and creates the JaxoGraph.
        Parameters:
        inputFileName - The name of the file to be opened.
      • setGraph

        public void setGraph(JaxoGraph graph)
      • getMode

        public final int getMode()
        Return the current drawing/editing mode.
        Returns:
        The current drawing/editing mode.
      • setMode

        public final void setMode(int newMode)
        Sets the current drawing/edit mode.
        Parameters:
        newMode - The drawing/edit mode to be set.
      • getCanvas

        public final JaxoCanvas getCanvas()
        Returns an instance of the canvas.
        Returns:
        The canvas.
      • isEditMode

        public final boolean isEditMode()
        Determines whether the current mode is an edit mode.
        Returns:
        True if the current mode is an edit mode.
      • isParticleMode

        public final boolean isParticleMode()
        Determines whether the current mode is a particle mode.
        Returns:
        True if the current mode is a particle mode.
      • isMiscMode

        public final boolean isMiscMode()
        Determines whether the current mode is a misc mode.
        Returns:
        True if the current mode is a misc mode.
      • reset

        public final void reset()
        Resets the canvas.
      • setFlagPanelCoordinates

        public final void setFlagPanelCoordinates(java.lang.String coordinates)
        Sets the coordinates in the flag panel.
        Parameters:
        coordinates - The coordinates to be set.
      • setFlagPanelMode

        public final void setFlagPanelMode(java.lang.String mode)
        Sets the current drawing/edit mode in the flag panel.
        Parameters:
        mode - The mode to be set.
      • setFlagPanelFileName

        public final void setFlagPanelFileName(java.lang.String filename)
        Sets the current file being edited in the flag panel.
        Parameters:
        filename - The filename to be set.
      • setLanguage

        public final void setLanguage(java.lang.String languageString)
        Sets the text and tool tips for all components of the panel (the menus, toolbar, button panels and status bar) in different languages.
        Parameters:
        languageString - A string specifying the language to be set.
      • particleEvent

        public final void particleEvent(int i)
        Processes the corresponding events whenever a particle button has been pressed.
        Parameters:
        i - An integer specifying the particle button that was pressed.
      • miscEvent

        public final void miscEvent(int i)
        Called when a misc item has been chosen from the button panel. Presses the corresponding button in the button panel, sets the mode in the flag panel, sets the current mode and shows all handles. Finally, makes sure that no object is selected.
        Parameters:
        i - Integer specifying the misc mode.
      • updateUI

        public void updateUI()
      • setAxes

        public void setAxes(int n1,
                            int n2)
      • editEvent

        public final void editEvent(int i)
        Called when an edit item has been chosen from the menu bar, the button panel or via key shortcuts. Presses the corresponding button in the button panel, sets the mode in the flag panel, sets the current mode and shows all handles. Finally, makes sure that no object is selected.
        Parameters:
        i - Integer specifying the edit mode.
      • fileEvent

        public final void fileEvent(int i)
        Called when a file item has been chosen from the menu , the tool bar or via key shortcuts. Calls the corresponding methods in the JaxoFileMenu.
        Parameters:
        i - Integer specifying the file event.
      • helpEvent

        public void helpEvent()
      • actionEvent

        public final void actionEvent(int i)
        Called when an action item has been chosen from the menu bar, the button panel or via key shortcuts. An action item calls for immediate action, without further input, currently there is Undo, Clear and Quit.
        Parameters:
        i - Integer specifying the action mode. Currently one of JaxoMainPanel.UNDO, JaxoMainPanel.CLEAR or JaxoMainPanel.QUIT.
      • clearData

        public void clearData(int padX,
                              int padY)
        Clear the data
      • update

        public void update()
        Update
      • resetButtons

        public final void resetButtons()
        Sets all the buttons as not pressed and hides the handles.
      • repaintCanvas

        public final void repaintCanvas()
        Repaints the canvas.
      • getSizeX

        public int getSizeX()
        Repaints the canvas.
      • getSizeY

        public int getSizeY()
        Repaints the canvas.
      • getGraph

        public JaxoGraph getGraph()
        Get graph of this canvas
      • shutdown

        public void shutdown()
        Clear from all objects and dispose the frame.
      • setSizeCanvas

        public void setSizeCanvas(int xsize,
                                  int ysize)
        set size
      • applyPrefs

        public final void applyPrefs()
        Applies the preferences.
      • showToolbar

        public final void showToolbar(boolean show)
        Switches the toolbar on or off.
        Parameters:
        show - A boolean variable that indicates whether the toolbar is visible or not.
      • showEditorbar

        public final void showEditorbar(boolean show)
        Switches the editor on or off.
        Parameters:
        show - A boolean variable that indicates whether the editor is visible or not.
      • showBrowserbar

        public final void showBrowserbar(boolean show)
        Switches the browser on or off.
        Parameters:
        show - A boolean variable that indicates whether the browser visible or not.
      • showStatusbar

        public final void showStatusbar(boolean show)
        Switches the status bar on or off.
        Parameters:
        show - A boolean variable that indicates whether the status bar is visible or not.
      • antialiasOn

        public final void antialiasOn(boolean on)
        Switches antialiasing on or off.
        Parameters:
        on - A boolean variable that indicates whether antialising is on or not.
      • gridOn

        public final void gridOn(boolean on)
        Switches the grid on or off.
        Parameters:
        on - A boolean variable that indicates whether the grid is on or not.
      • arrow

        public final void arrow(boolean on)
        Determines whether to draw arrows on lines, arcs and loops.
        Parameters:
        on - A boolean variable that indicates whether to draw arrows on lines, arcs and loops.
      • setVertexType

        public final void setVertexType(int type)
        Sets the current type of vertex.
        Parameters:
        type - An integer specifying the vertex type.
      • getVertexType

        public final int getVertexType()
        Returns the current vertex type.
        Returns:
        The current vertex type.
      • setClipboard

        public final void setClipboard(JaxoGraph newClipboard)
        Sets the clipboard.
        Parameters:
        newClipboard - A JaxoGraph containing the new clipboard.
      • getClipboard

        public final JaxoGraph getClipboard()
        Returns the current clipboard.
        Returns:
        The current clipboard.
      • setSnap

        public final void setSnap(boolean newSnap)
        Sets the snap mode.
        Parameters:
        newSnap - The new snap mode.
      • getSnap

        public final boolean getSnap()
        Returns the current snap mode.
        Returns:
        The current snap mode.
      • isWatchMode

        public final boolean isWatchMode()
        Indicates whether watch mode is active or not.
        Returns:
        True when watch mode is active, false otherwise.
      • setWatchMode

        public final void setWatchMode(boolean choice)
        Sets the current watch mode.
        Parameters:
        choice - True, if watch mode is to be switched on, false otherwise.
      • getPbtPanel

        public final JaxoParticleButtons getPbtPanel()
        Returns the particle button panel.
        Returns:
        The current particle button panel.
      • getEbtPanel

        public final JaxoEditButtons getEbtPanel()
        Returns the edit button panel.
        Returns:
        The current edit button panel.
      • getMbtPanel

        public final JaxoMiscButtons getMbtPanel()
        Returns the miscellaneous button panel.
        Returns:
        The current miscalleneous button panel.
      • getGbtPanel

        public final JaxoGridButtons getGbtPanel()
        Returns the grid button panel.
        Returns:
        The current grid button panel.
      • getCanvasPanel

        public final JaxoTabbedCanvasPanel getCanvasPanel()
        Returns the particle button panel.
        Returns:
        The current particle button panel.
      • getOptMenu

        public final JaxoOptionsMenu getOptMenu()
        Returns the options menu.
        Returns:
        The current options menu.
      • setZoom

        public final void setZoom(JaxoZoom z)
        Sets the zoom.
        Parameters:
        z - The zoom.
      • getZoom

        public final JaxoZoom getZoom()
        Returns the zoom.
        Returns:
        The zoom.
      • updateZoom

        public final void updateZoom()
        Initializes the zoom: sets the background image, graphics context, image dimensions and canvas dimensions.
      • fillBrowser

        public final void fillBrowser(java.util.Map<java.lang.String,java.lang.Object> map)
        Fill browser.
        Parameters:
        map -
      • exportImage

        public void exportImage()
        Exports the image to some graphic format using a dialog
      • export

        public void export(java.lang.String file)
        Fast export of the canvas to an image file (depends on the extension, i.e. PNG, PDF, EPS, PS). No questions will be asked, an existing file will be rewritten
        Parameters:
        file - Output file with the proper extension. If no extension, PNG file is assumed.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.