Documentation of 'org.jhotdraw.gui.fontchooser.DefaultFontChooserModel' Java class
DefaultFontChooserModel
org.jhotdraw.gui.fontchooser

Class DefaultFontChooserModel

  • All Implemented Interfaces:
    javax.swing.tree.TreeModel, FontChooserModel
    Direct Known Subclasses:
    DefaultFontChooserModel.UIResource


    public class DefaultFontChooserModel
    extends AbstractFontChooserModel
    DefaultFontChooserModel with a predefined set of font collections.

    Loading the fonts may take a lot of time. Therefore it is recommended to create a Future during the startup of an application, and set the fonts in the font chooser model when they are needed.

    Example:

       private static FutureTask future = new FutureTask(new Callable() {
    
          public Font[] call() throws Exception {
              return GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
    
           }
       });
     
    • Constructor Detail

      • DefaultFontChooserModel

        public DefaultFontChooserModel()
      • DefaultFontChooserModel

        public DefaultFontChooserModel(java.awt.Font[] fonts)
    • Method Detail

      • setFonts

        public void setFonts(java.awt.Font[] fonts)
        Sets the fonts of the DefaultFontChooserModel.

        Fires treeStructureChanged event on the root node.

        Parameters:
        fonts -
      • isEditable

        public boolean isEditable(javax.swing.tree.MutableTreeNode node)
        Description copied from interface: FontChooserModel
        Returns true if node is editable by the user. This method returns true, if the node and all its parents are editable.
        Parameters:
        node - a node in the tree, obtained from this data source
        Returns:
        true if node is editable
      • getRoot

        public java.lang.Object getRoot()
      • getChild

        public java.lang.Object getChild(java.lang.Object parent,
                                         int index)
      • getChildCount

        public int getChildCount(java.lang.Object parent)
      • isLeaf

        public boolean isLeaf(java.lang.Object node)
      • valueForPathChanged

        public void valueForPathChanged(javax.swing.tree.TreePath path,
                                        java.lang.Object newValue)
      • getIndexOfChild

        public int getIndexOfChild(java.lang.Object parent,
                                   java.lang.Object child)

DataMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.