Class DrawingSurface

    • Constructor Detail

      • DrawingSurface

        public DrawingSurface​(Object id,
                              int serialNumber,
                              InternalFrameInterface displayer,
                              CopyContext copyContext)
        displayer can be null when no gui is linked to this.
        Parameters:
        id - id
        copyContext - copyContext
        serialNumber - serialNumber
        displayer - displayer
    • Method Detail

      • addAction

        public void addAction​(ActionObject action)
        Insert the method's description here. Creation date: (22.4.2001 18:44:03)
        Parameters:
        action - com.cosylab.vdct.undo.ActionObject
      • baseView

        public void baseView()
        Insert the method's description here. Creation date: (1.5.2001 17:32:20)
      • draw

        public void draw​(Graphics g)
        Insert the method's description here. Creation date: (10.12.2000 13:19:16)
        Specified by:
        draw in interface VisualComponent
        Overrides:
        draw in class Decorator
        Parameters:
        g - g
      • getNumberOfPages

        public int getNumberOfPages()
        Returns the number of pages in the set. To enable advanced printing features, it is recommended that Pageable implementations return the true number of pages rather than the UNKNOWN_NUMBER_OF_PAGES constant.
        Specified by:
        getNumberOfPages in interface Pageable
        Returns:
        the number of pages in this Pageable.
      • getPageFormat

        public PageFormat getPageFormat​(int pageIndex)
                                 throws IndexOutOfBoundsException
        Returns the PageFormat of the page specified by pageIndex.
        Specified by:
        getPageFormat in interface Pageable
        Parameters:
        pageIndex - the zero based index of the page whose PageFormat is being requested
        Returns:
        the PageFormat describing the size and orientation.
        Throws:
        IndexOutOfBoundsException - foo the Pageable does not contain the requested page.
      • getPressedX

        public int getPressedX()
        Insert the method's description here. Creation date: (3.2.2001 23:39:28)
        Returns:
        int
      • getPressedY

        public int getPressedY()
        Insert the method's description here. Creation date: (3.2.2001 23:39:28)
        Returns:
        int
      • resetDraggedPosition

        public void resetDraggedPosition()
      • getPrintable

        public Printable getPrintable​(int pageIndex)
                               throws IndexOutOfBoundsException
        Returns the Printable instance responsible for rendering the page specified by pageIndex.
        Specified by:
        getPrintable in interface Pageable
        Parameters:
        pageIndex - the zero based index of the page whose Printable is being requested
        Returns:
        the Printable that renders the page.
        Throws:
        IndexOutOfBoundsException - foo the Pageable does not contain the requested page.
      • getView

        public ViewState getView()
        Insert the method's description here. Creation date: (1.5.2001 17:55:20)
        Returns:
        com.cosylab.vdct.graphics.ViewState
      • getViewGroup

        public Group getViewGroup()
        Insert the method's description here. Creation date: (3.2.2001 22:58:19)
        Returns:
        com.cosylab.vdct.graphics.objects.Group
      • initializeWorkspace

        public void initializeWorkspace()
        Insert the method's description here. Creation date: (8.1.2001 18:04:49)
      • isFlat

        public boolean isFlat()
        Insert the method's description here. Creation date: (1.5.2001 17:51:29)
        Returns:
        boolean
      • isModified

        public boolean isModified()
        Insert the method's description here. Creation date: (1.2.2001 14:24:51)
        Specified by:
        isModified in interface DrawingSurfaceInterface
        Returns:
        boolean
      • linkCommand

        public void linkCommand​(VisibleObject linkObject,
                                LinkSource linkData)
        Insert the method's description here. Creation date: (3.2.2001 13:31:09)
        Specified by:
        linkCommand in interface LinkCommandInterface
        Parameters:
        linkObject - linkObject
        linkData - linkData
      • mouseClicked

        public void mouseClicked​(MouseEvent e)
        Invoked when the mouse has been clicked on a component.
        Specified by:
        mouseClicked in interface MouseListener
        Parameters:
        e - e
      • mouseDragged

        public void mouseDragged​(MouseEvent e)
        Invoked when a mouse button is pressed on a component and then dragged. Mouse drag events will continue to be delivered to the component where the first originated until the mouse button is released (regardless of whether the mouse position is within the bounds of the component).
        Specified by:
        mouseDragged in interface MouseMotionListener
        Parameters:
        e - e
      • mouseEntered

        public void mouseEntered​(MouseEvent e)
        Invoked when the mouse enters a component.
        Specified by:
        mouseEntered in interface MouseListener
        Parameters:
        e - e
      • mouseExited

        public void mouseExited​(MouseEvent e)
        Invoked when the mouse exits a component.
        Specified by:
        mouseExited in interface MouseListener
        Parameters:
        e - e
      • mouseMoved

        public void mouseMoved​(MouseEvent e)
        Invoked when the mouse button has been moved on a component (with no buttons no down).
        Specified by:
        mouseMoved in interface MouseMotionListener
        Parameters:
        e - e
      • mousePressed

        public void mousePressed​(MouseEvent e)
        Invoked when a mouse button has been pressed on a component.
        Specified by:
        mousePressed in interface MouseListener
        Parameters:
        e - e
      • mouseReleased

        public void mouseReleased​(MouseEvent e)
        Invoked when a mouse button has been released on a component.
        Specified by:
        mouseReleased in interface MouseListener
        Parameters:
        e - e
      • moveLevelUp

        public void moveLevelUp()
        Insert the method's description here. Creation date: (28.1.2001 18:39:57)
      • open

        public boolean open​(File file)
                     throws IOException
        Insert the method's description here. Creation date: (6.1.2001 22:35:40)
        Parameters:
        file - java.io.File
        Returns:
        something
        Throws:
        IOException - foo
      • open

        public boolean open​(File file,
                            boolean importDB)
                     throws IOException
        Insert the method's description here. Creation date: (6.1.2001 22:35:40)
        Specified by:
        open in interface DrawingSurfaceInterface
        Parameters:
        file - java.io.File
        importDB - importDB
        Returns:
        something
        Throws:
        IOException - foo
      • checkForIncodedDBDs

        public void checkForIncodedDBDs​(File file)
                                 throws IOException
        jh Creation date: (6.1.2001 22:35:40)
        Parameters:
        file - file
        Throws:
        IOException - foo
      • importFields

        public boolean importFields​(File file,
                                    boolean ignoreLinkFields)
        Import the fields from a .db file (option to ignore database link fields). Only the fields of the records that are already defined in VDCT are overriden with the new settings. This would allow easy definition of the limits, hardware addresses, display range etc.
        Parameters:
        file - file
        ignoreLinkFields - ignoreLinkFields
        Returns:
        something
      • importBorder

        public boolean importBorder​(File file)
        Parameters:
        file - file
        Returns:
        something
      • open

        public boolean open​(File file,
                            boolean importDB,
                            boolean importToCurrentGroup)
                     throws IOException
        Parameters:
        file - file
        importDB - importDB
        importToCurrentGroup - importToCurrentGroup
        Returns:
        something
        Throws:
        IOException - foo
      • open

        public boolean open​(InputStream is,
                            File file,
                            boolean importDB,
                            boolean importToCurrentGroup)
                     throws IOException
        SEPARATE DOWN CODE TO METHODS Creation date: (6.1.2001 22:35:40)
        Parameters:
        is - is
        file - java.io.File
        importToCurrentGroup - importToCurrentGroup
        importDB - importDB
        Returns:
        something
        Throws:
        IOException - foo
      • loadRdbDbGroup

        public boolean loadRdbDbGroup​(JFrame guiContext)
        Parameters:
        guiContext - guiContext
        Returns:
        something
      • saveRdbGroup

        public boolean saveRdbGroup​(JFrame guiContext,
                                    RdbDataId rdbId,
                                    boolean dialog)
        Parameters:
        guiContext - guiContext
        rdbId - rdbId
        dialog - dialog
        Returns:
        something
      • importDB

        public boolean importDB​(File file)
                         throws IOException
        SEPARATE DOWN CODE TO METHODS Creation date: (6.1.2001 22:35:40)
        Parameters:
        file - java.io.File
        Returns:
        something
        Throws:
        IOException - foo
      • applyPortAndMacroConnectors

        public static void applyPortAndMacroConnectors​(Object dsId,
                                                       DBData dbData,
                                                       VDBData vdbData)
        Parameters:
        dsId - dsId
        dbData - dbData
        vdbData - vdbData
      • applyVisualData

        public static HashMap applyVisualData​(Object dsId,
                                              boolean importDB,
                                              Group group,
                                              DBData dbData,
                                              VDBData vdbData)
        Insert the method's description here.
        Parameters:
        dsId - dsId
        importDB - importDB
        group - group
        dbData - dbData
        vdbData - vdbData
        Returns:
        something
      • openDBD

        public boolean openDBD​(File file)
                        throws IOException
        Insert the method's description here. Creation date: (6.1.2001 22:35:40)
        Parameters:
        file - java.io.File
        Returns:
        something
        Throws:
        IOException - foo
      • openDBD

        public boolean openDBD​(File file,
                               boolean importDBD)
                        throws IOException
        Insert the method's description here. Creation date: (6.1.2001 22:35:40)
        Parameters:
        file - java.io.File
        importDBD - importDBD
        Returns:
        something
        Throws:
        IOException - foo
      • print

        public int print​(Graphics graphics,
                         PageFormat pageFormat,
                         int pageIndex)
                  throws PrinterException
        Prints the page at the specified index into the specified Graphics context in the specified format. A PrinterJob calls the Printable interface to request that a page be rendered into the context specified by graphics. The format of the page to be drawn is specified by pageFormat. The zero based index of the requested page is specified by pageIndex. If the requested page does not exist then this method returns NO_SUCH_PAGE; otherwise PAGE_EXISTS is returned. The Graphics class or subclass implements the PrinterGraphics interface to provide additional information. If the Printable object aborts the print job then it throws a PrinterException.
        Specified by:
        print in interface Printable
        Parameters:
        graphics - the context into which the page is drawn
        pageFormat - the size and orientation of the page being drawn
        pageIndex - the zero based index of the page to be drawn
        Returns:
        PAGE_EXISTS if the page is rendered successfully or NO_SUCH_PAGE if pageIndex specifies a non-existent page.
        Throws:
        PrinterException - thrown when the print job is terminated.
      • recalculateNavigatorPosition

        public void recalculateNavigatorPosition()
        Insert the method's description here. Creation date: (27.12.2000 15:04:17)
      • run

        public void run()
        DrawingSurface thread. Aim of this thread is to optimize drawing on the surface. It could happen that repaint() method is called very often (e.g. 100-times per second). Drawing at such rate is non-sence. The idea is to repaint whole workspace at maximum rate of 10 repaints/second.
        Specified by:
        run in interface Runnable
        See Also:
        Runnable.run()
      • repaint

        public void repaint​(boolean drawOnlyHilitedOnce)
        Insert the method's description here. Creation date: (25.12.2000 14:59:05)
        Parameters:
        drawOnlyHilitedOnce - drawOnlyHilitedOnce
      • repaint

        public void repaint()
        Insert the method's description here. Creation date: (25.12.2000 14:59:05)
      • resize

        public void resize​(int x0,
                           int y0,
                           int width,
                           int height)
        Insert the method's description here. Creation date: (10.12.2000 13:19:16)
        Specified by:
        resize in interface VisualComponent
        Overrides:
        resize in class Decorator
        Parameters:
        x0 - x0
        y0 - y0
        width - width
        height - height
      • setModified

        public void setModified​(boolean newModified)
        Insert the method's description here. Creation date: (1.2.2001 14:24:51)
        Parameters:
        newModified - boolean
      • setScale

        public void setScale​(double scale)
        Insert the method's description here. Creation date: (29.12.2000 12:40:13)
        Parameters:
        scale - double
      • centerObject

        public void centerObject​(VisibleObject object)
        Insert the method's description here. Creation date: (29.12.2000 12:40:13)
        Parameters:
        object - object
      • updateWorkspaceScale

        public void updateWorkspaceScale()
        Insert the method's description here. Creation date: (29.12.2000 12:49:54)
      • zoomArea

        public void zoomArea​(int x1,
                             int y1,
                             int x2,
                             int y2)
        Insert the method's description here. Creation date: (25.12.2000 16:49:07)
        Parameters:
        x1 - int
        y1 - int
        x2 - int
        y2 - int
      • createTemplateInstance

        public void createTemplateInstance​(String name,
                                           String type,
                                           boolean relative)
        Insert the method's description here. Creation date: (3.2.2001 23:27:30)
        Parameters:
        name - java.lang.String
        type - java.lang.String
        relative - boolean
      • prepareTemplateLeave

        public boolean prepareTemplateLeave()
        true - OK, false - denied
        Returns:
        something
      • templateReloadPostInit

        public void templateReloadPostInit()
      • descendIntoTemplate

        public void descendIntoTemplate​(Template template)
        Insert the method's description here. Creation date: (22.4.2001 18:44:03)
        Parameters:
        template - com.cosylab.vdct.graphics.objects.Template
      • ascendFromTemplate

        public void ascendFromTemplate()
        Insert the method's description here. Creation date: (22.4.2001 18:44:03)
      • moveToGroup

        public void moveToGroup​(Group group)
        Insert the method's description here. Creation date: (22.4.2001 18:44:03)
        Parameters:
        group - com.cosylab.vdct.graphics.objects.Group
      • updateWorkspaceGroup

        public void updateWorkspaceGroup()
        Insert the method's description here. Creation date: (22.4.2001 18:44:03)
      • getTemplateStack

        public Stack getTemplateStack()
        Returns the templateStack.
        Returns:
        Stack
      • setBlockNavigatorRedrawOnce

        public void setBlockNavigatorRedrawOnce​(boolean blockNavigatorRedrawOnce)
        Sets the blockNavigatorRedrawOnce.
        Parameters:
        blockNavigatorRedrawOnce - The blockNavigatorRedrawOnce to set
      • loadWhiteOnBlackColorScheme

        public static void loadWhiteOnBlackColorScheme()
        Loads white on black color cheme
      • loadBlackOnWhiteColorScheme

        public static void loadBlackOnWhiteColorScheme()
        Loads black on white color cheme
      • createPort

        public void createPort​(VDBPort vdbPort)
        Insert the method's description here. Creation date: (3.2.2001 23:27:30)
        Parameters:
        vdbPort - vdbPort
      • createMacro

        public Macro createMacro​(VDBMacro vdbMacro)
        Insert the method's description here. Creation date: (3.2.2001 23:27:30)
        Parameters:
        vdbMacro - vdbMacro
        Returns:
        something
      • generateMacros

        public void generateMacros()
        Searches for undefined macros
      • isPrinting

        public boolean isPrinting()
        Returns:
        something
      • reset

        public void reset()
      • setPressedMousePos

        public void setPressedMousePos​(int x,
                                       int y)
        Parameters:
        x - x
        y - y
      • getGuimenu

        public DSGUIInterface getGuimenu()
        Returns:
        the guimenu
      • isDisposed

        public boolean isDisposed()
        Returns:
        something
      • setDisposed

        public void setDisposed​(boolean disposed)
        Parameters:
        disposed - disposed
      • updateFile

        public void updateFile​(File file)
        Parameters:
        file - file
      • isTemplateAllowed

        public boolean isTemplateAllowed​(VDBTemplate template)
        Returns true if a template instance of the given template can be added as an element to currently edited template. Returns false if there is a cyclic template dependency.
        Specified by:
        isTemplateAllowed in interface DrawingSurfaceInterface
        Parameters:
        template - template
        Returns:
        something