org.mlc.swing.layout
Class ComponentDef

java.lang.Object
  extended by org.mlc.swing.layout.ComponentDef
All Implemented Interfaces:
java.lang.Comparable<java.lang.Object>

public class ComponentDef
extends java.lang.Object
implements java.lang.Comparable<java.lang.Object>

A container class for all the definition data about a Component. Instances of this class make up the component palette and are used when creating and editing component data.

Since:
Ptolemy II 8.0
Version:
$Id: ComponentDef.java 57046 2010-01-27 23:35:53Z cxh $
Author:
Michael Connor

Field Summary
 java.lang.String add
           
 java.lang.String configure
           
 java.lang.String declarations
           
private  java.lang.String description
           
 javax.swing.Icon icon
           
 java.lang.String iconClass
           
 java.lang.String imports
           
 boolean isContainer
           
 java.lang.String name
           
 java.lang.String preview
           
 java.lang.String remove
           
private static long serialVersionUID
           
 
Constructor Summary
ComponentDef()
           
ComponentDef(org.w3c.dom.Node componentNode)
           
ComponentDef(java.lang.String name, java.lang.String imp, java.lang.String decl, java.lang.String add)
           
 
Method Summary
 ComponentDef clone()
          When dragging from the palette we need a clone rather than modify the original.
 int compareTo(java.lang.Object o)
          Make it sortable on name so the palette is ordered.
static java.util.List<ComponentDef> createComponentDefs()
          Creates a new instance of Component Palette.
private  java.lang.String doNode(org.w3c.dom.Node parent, java.lang.String nodeName)
           
 java.lang.String getAdd(java.lang.String name)
           
private static java.util.Map<java.lang.String,java.lang.String> getAttributeMap(org.w3c.dom.Node node)
           
private static java.io.InputStream getCompFile()
           
 java.lang.String getConfigure(java.lang.String name)
           
 java.lang.String getDeclarations(java.lang.String name)
           
 java.lang.String getDescription()
           
 java.lang.String getImports(java.lang.String name)
           
private static org.w3c.dom.Node[] getNodesNamed(org.w3c.dom.Node parent, java.lang.String nodeName)
           
private  java.lang.String getTextContent(org.w3c.dom.Node anode)
           
(package private)  void getTextContent(org.w3c.dom.Node anode, java.lang.StringBuffer buf)
           
(package private)  boolean hasTextContent(org.w3c.dom.Node child)
           
static void main(java.lang.String[] args)
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

name

public java.lang.String name

iconClass

public java.lang.String iconClass

icon

public javax.swing.Icon icon

declarations

public java.lang.String declarations

configure

public java.lang.String configure

add

public java.lang.String add

remove

public java.lang.String remove

imports

public java.lang.String imports

preview

public java.lang.String preview

isContainer

public boolean isContainer

description

private java.lang.String description
Constructor Detail

ComponentDef

public ComponentDef()

ComponentDef

public ComponentDef(org.w3c.dom.Node componentNode)

ComponentDef

public ComponentDef(java.lang.String name,
                    java.lang.String imp,
                    java.lang.String decl,
                    java.lang.String add)
Method Detail

getDescription

public java.lang.String getDescription()

hasTextContent

final boolean hasTextContent(org.w3c.dom.Node child)

getTextContent

void getTextContent(org.w3c.dom.Node anode,
                    java.lang.StringBuffer buf)

getTextContent

private java.lang.String getTextContent(org.w3c.dom.Node anode)

doNode

private java.lang.String doNode(org.w3c.dom.Node parent,
                                java.lang.String nodeName)

getCompFile

private static java.io.InputStream getCompFile()

createComponentDefs

public static java.util.List<ComponentDef> createComponentDefs()
Creates a new instance of Component Palette. All component configurations are pulled out of components.xml


getAttributeMap

private static java.util.Map<java.lang.String,java.lang.String> getAttributeMap(org.w3c.dom.Node node)

getNodesNamed

private static org.w3c.dom.Node[] getNodesNamed(org.w3c.dom.Node parent,
                                                java.lang.String nodeName)

getConfigure

public java.lang.String getConfigure(java.lang.String name)

getImports

public java.lang.String getImports(java.lang.String name)

getDeclarations

public java.lang.String getDeclarations(java.lang.String name)

getAdd

public java.lang.String getAdd(java.lang.String name)

clone

public ComponentDef clone()
When dragging from the palette we need a clone rather than modify the original.

Overrides:
clone in class java.lang.Object

compareTo

public int compareTo(java.lang.Object o)
Make it sortable on name so the palette is ordered.

Specified by:
compareTo in interface java.lang.Comparable<java.lang.Object>

main

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