程序包 weka.gui.beans

类 BeanVisual

所有已实现的接口:
ImageObserver, MenuContainer, Serializable, Accessible

public class BeanVisual extends JPanel
BeanVisual encapsulates icons and label for a given bean. Has methods to load icons, set label text and toggle between static and animated versions of a bean's icon.
从以下版本开始:
1.0
版本:
$Revision: 1.10 $
作者:
Mark Hall
另请参阅:
  • 字段详细资料

    • ICON_PATH

      public static final String ICON_PATH
      另请参阅:
    • NORTH_CONNECTOR

      public static final int NORTH_CONNECTOR
      另请参阅:
    • SOUTH_CONNECTOR

      public static final int SOUTH_CONNECTOR
      另请参阅:
    • EAST_CONNECTOR

      public static final int EAST_CONNECTOR
      另请参阅:
    • WEST_CONNECTOR

      public static final int WEST_CONNECTOR
      另请参阅:
  • 构造器详细资料

    • BeanVisual

      public BeanVisual(String visualName, String iconPath, String animatedIconPath)
      Constructor
      参数:
      visualName - name for the bean
      iconPath - path to the icon file
      animatedIconPath - path to the animated icon file
  • 方法详细资料

    • scale

      public void scale(int factor)
      Reduce this BeanVisual's icon size by the given factor
      参数:
      factor - the factor by which to reduce the icon size by
    • 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.
      参数:
      iconPath - path to
      animatedIconPath - a String value
    • setText

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

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

      public void setStatic()
      Set the static version of the icon
    • setAnimated

      public void setAnimated()
      Set the animated version of the icon
    • 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.
      参数:
      pt - the reference point
      返回:
      the closest connector point
    • getConnectorPoint

      public Point getConnectorPoint(int compassPoint)
      Returns the coordinates of the connector point given a compass point
      参数:
      compassPoint - a compass point
      返回:
      a Point value
    • getStaticIcon

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

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

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

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

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

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

      public void addPropertyChangeListener(PropertyChangeListener pcl)
      Add a listener for property change events
      覆盖:
      addPropertyChangeListener 在类中 Container
      参数:
      pcl - a PropertyChangeListener value
    • removePropertyChangeListener

      public void removePropertyChangeListener(PropertyChangeListener pcl)
      Remove a property change listener
      覆盖:
      removePropertyChangeListener 在类中 Component
      参数:
      pcl - a PropertyChangeListener value
    • paintComponent

      public void paintComponent(Graphics gx)