Class BeanVisual

    • Constructor Detail

      • BeanVisual

        public BeanVisual​(String visualName,
                          String iconPath,
                          String animatedIconPath)
        Constructor
        Parameters:
        visualName - name for the bean
        iconPath - path to the icon file
        animatedIconPath - path to the animated icon file
    • Method Detail

      • scale

        public void scale​(int factor)
        Reduce this BeanVisual's icon size by the given factor
        Parameters:
        factor - the factor by which to reduce the icon size by
      • scale

        public Image scale​(double percent)
      • loadIcons

        public boolean loadIcons​(String iconPath,
                                 String animatedIconPath)
        Loads static and animated versions of a beans icons. These are assumed to be defined in the system resource location (i.e. in the CLASSPATH). If the named icons do not exist, no changes to the visual appearance is made. Since default icons for generic types of beans (eg. DataSource, Classifier etc) are assumed to exist, it allows developers to add custom icons for for specific instantiations of these beans (eg. J48, DiscretizeFilter etc) at their leisure.
        Parameters:
        iconPath - path to
        animatedIconPath - a String value
      • setText

        public void setText​(String text)
        Set the label for the visual. Informs any property change listeners
        Parameters:
        text - the label
      • getText

        public String getText()
        Get the visual's label
        Returns:
        a String value
      • setStatic

        @Deprecated
        public void setStatic()
        Deprecated.
        Set the static version of the icon. This method has been deprecated and now has no affect. A future version of the KnowledgeFlow application may orchestrate the display of which components are active graphically
      • setAnimated

        @Deprecated
        public void setAnimated()
        Deprecated.
        Set the animated version of the icon This method has been deprecated and now has no affect. A future version of the KnowledgeFlow application may orchestrate the display of which components are active graphically
      • getClosestConnectorPoint

        public Point getClosestConnectorPoint​(Point pt)
        Returns the coordinates of the closest "connector" point to the supplied point. Coordinates are in the parent containers coordinate space.
        Parameters:
        pt - the reference point
        Returns:
        the closest connector point
      • getConnectorPoint

        public Point getConnectorPoint​(int compassPoint)
        Returns the coordinates of the connector point given a compass point
        Parameters:
        compassPoint - a compass point
        Returns:
        a Point value
      • getStaticIcon

        public ImageIcon getStaticIcon()
        Returns the static icon
        Returns:
        an ImageIcon value
      • getAnimatedIcon

        public ImageIcon getAnimatedIcon()
        Returns the animated icon
        Returns:
        an ImageIcon value
      • getIconPath

        public String getIconPath()
        returns the path for the icon
        Returns:
        the path for the icon
      • getAnimatedIconPath

        public String getAnimatedIconPath()
        returns the path for the animated icon
        Returns:
        the path for the animated icon
      • setDisplayConnectors

        public void setDisplayConnectors​(boolean dc)
        Turn on/off the connector points
        Parameters:
        dc - a boolean value
      • setDisplayConnectors

        public void setDisplayConnectors​(boolean dc,
                                         Color c)
        Turn on/off the connector points
        Parameters:
        dc - a boolean value
        c - the Color to use
      • paintComponent

        public void paintComponent​(Graphics gx)