Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Multivalent API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## multivalent
Class StyleSheet

    java.lang.Object
      multivalent.StyleSheet

All Implemented Interfaces:
  java.lang.Cloneable

Direct Known Subclasses:
  CSS

public class StyleSheet
extends java.lang.Object
implements java.lang.Cloneable

Map structural name pattern into ContextListener to add to Context's list of active behaviors. This is the superclass for all StyleSheets. It implements a simple style sheet that just uses VObject name and VObject handle as selectors -- no class, id, context, no nested selectors, no textual form (everything set programmatically).

Version:
  $Revision: 1.7 $ $Date: 2005/01/01 13:37:41 $
See Also:
  `CSS`

Field Summary
`protected StyleSheet` | `cascade_` Link to lower priority style sheet.
`protected Context` | `cx_`
`static boolean` | `DEBUG`
`java.util.Map<java.lang.Object,ContextListener>` | `key2cl_`
`protected java.lang.String` | `name_`
`static int` | `PRIORITY_BLOCK`
`static int` | `PRIORITY_CLASS`
`static int` | `PRIORITY_ELEMENT`
`static int` | `PRIORITY_ID`
`static int` | `PRIORITY_INLINE`
`protected static java.lang.Object` | `TERMINAL`

Constructor Summary
`StyleSheet()`

Method Summary
`void` | `activesAdd(java.util.List<ContextListener> actives, VObject o, Node parent)` Add all relevant ContextListeners to Context.
`void` | `activesRemove(java.util.List<ContextListener> actives, VObject o, Node parent)`
`StyleSheet` | `copy()`
`protected Context` | `createContext()` Create new Context matched to this StyleSheet's ContextListeners.
`static int` | `eatSpace(java.lang.String str, int inx)` Arbitrary behaviors can be associated with styles.
`ContextListener` | `get(java.lang.Object key)` Low level: hash on object itself.
`ContextListener` | `get(java.lang.Object key, Node context)`
`StyleSheet` | `getCascade()`
`StyleSheet` | `getCascade(java.lang.String name)`
`Context` | `getContext()`
`Context` | `getContext(java.awt.Graphics2D g, Context enclosing)` Return Context matched to this StyleSheet's ContextListeners.
`java.lang.String` | `getName()`
`void` | `parse(java.lang.String csstxt, java.net.URL base)` Parse internal style sheet.
`void` | `parse(java.net.URL url)` Parse external style sheet.
`void` | `put(java.lang.Object key, ContextListener cl)` Low level: hash on object itself.
`void` | `put(java.lang.String selector, ContextListener cl)` More sophisticated style sheet implementation can parse selector.
`ContextListener` | `remove(java.lang.Object key)`
`ContextListener` | `remove(java.lang.String selector)`
`void` | `setAttr(CLGeneral gs, java.lang.String name, java.lang.String value)` Parse attribute name-value pair into settings in CLGeneral.
`void` | `setAttrs(CLGeneral gs, java.lang.String pairs)` Parse attribute name-value pair into settings in CLGeneral.
`void` | `setCascade(Document doc)`
`void` | `setCascade(StyleSheet parent)`
`void` | `setName(java.lang.String name)` LATER Cache last lookup, so faster if have add immediately followed by remove on same args.
`void` | `setPriority(java.lang.String selector, CLGeneral cl)` Compute priority of passed selector.
`int` | `size()`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### DEBUG

    public static final boolean DEBUG

See Also:
  Constant Field Values

### PRIORITY_INLINE

    public static final int PRIORITY_INLINE

See Also:
  Constant Field Values

### PRIORITY_BLOCK

    public static final int PRIORITY_BLOCK

See Also:
  Constant Field Values

### PRIORITY_ID

    public static final int PRIORITY_ID

See Also:
  Constant Field Values

### PRIORITY_CLASS

    public static final int PRIORITY_CLASS

See Also:
  Constant Field Values

### PRIORITY_ELEMENT

    public static final int PRIORITY_ELEMENT

See Also:
  Constant Field Values

### TERMINAL

    protected static final java.lang.Object TERMINAL

### cx_

    protected Context cx_

### name_

    protected java.lang.String name_

### cascade_

    protected StyleSheet cascade_

  Link to lower priority style sheet.

### key2cl_

    public java.util.Map<java.lang.Object,ContextListener> key2cl_

Constructor Detail

### StyleSheet

    public StyleSheet()

Method Detail

### setName

    public void setName(java.lang.String name)

  LATER Cache last lookup, so faster if have add immediately followed by remove on same args. Invalidated by put. protected String lastvojb_=null, lastcx_=null; protected ContextListener[] lastcl_ = null;

### getName

    public java.lang.String getName()

### getCascade

    public StyleSheet getCascade()

### getCascade

    public StyleSheet getCascade(java.lang.String name)

### setCascade

    public void setCascade(StyleSheet parent)

### setCascade

    public void setCascade(Document doc)

### copy

    public StyleSheet copy()

### size

    public int size()

### getContext

    public Context getContext(java.awt.Graphics2D g,
                              Context enclosing)

  Return Context matched to this StyleSheet's ContextListeners. This context inherits from prevailing: Graphics2D, base_, signals.

### getContext

    public Context getContext()

### createContext

    protected Context createContext()

  Create new Context matched to this StyleSheet's ContextListeners. StyleSheet subclasses should override.

### activesAdd

    public void activesAdd(java.util.List<ContextListener> actives,
                           VObject o,
                           Node parent)

  Add all relevant ContextListeners to Context. After invoking parent cascade, this simple implementation tries VObject's name and handle as selectors. Called directly by Leaf, indirectly by INode through paintBefore.

### activesRemove

    public void activesRemove(java.util.List<ContextListener> actives,
                              VObject o,
                              Node parent)

### put

    public void put(java.lang.Object key,
                    ContextListener cl)

  Low level: hash on object itself.

### put

    public void put(java.lang.String selector,
                    ContextListener cl)

  More sophisticated style sheet implementation can parse selector.

### get

    public ContextListener get(java.lang.Object key)

  Low level: hash on object itself.

### get

    public ContextListener get(java.lang.Object key,
                               Node context)

### remove

    public ContextListener remove(java.lang.Object key)

### remove

    public ContextListener remove(java.lang.String selector)

### parse

    public void parse(java.net.URL url)

  Parse external style sheet.

### parse

    public void parse(java.lang.String csstxt,
                      java.net.URL base)

  Parse internal style sheet. No definition in this simple style sheet -- have to set programmatically.

### setAttr

    public void setAttr(CLGeneral gs,
                        java.lang.String name,
                        java.lang.String value)

  Parse attribute name-value pair into settings in CLGeneral.

### setAttrs

    public void setAttrs(CLGeneral gs,
                         java.lang.String pairs)

  Parse attribute name-value pair into settings in CLGeneral.

### setPriority

    public void setPriority(java.lang.String selector,
                            CLGeneral cl)

  Compute priority of passed selector.

### eatSpace

    public static int eatSpace(java.lang.String str,
                               int inx)

  Arbitrary behaviors can be associated with styles.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Multivalent API
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD