Class FieldFactory

    • Field Detail

      • FONT_OPTION_NAME

        public static final java.lang.String FONT_OPTION_NAME
        See Also:
        Constant Field Values
      • DEFAULT_FIELD_FONT

        public static final java.awt.Font DEFAULT_FIELD_FONT
      • name

        protected java.lang.String name
      • startX

        protected int startX
      • width

        protected int width
      • color

        protected java.awt.Color color
      • underlineColor

        protected java.awt.Color underlineColor
      • baseFont

        protected java.awt.Font baseFont
      • style

        protected int style
      • enabled

        protected boolean enabled
      • colorOptionName

        protected java.lang.String colorOptionName
      • styleOptionName

        protected java.lang.String styleOptionName
      • displayOptions

        protected Options displayOptions
    • Constructor Detail

      • FieldFactory

        protected FieldFactory​(java.lang.String name,
                               FieldFormatModel model,
                               HighlightProvider highlightProvider,
                               Options displayOptions,
                               Options fieldOptions)
        Base constructor
        Parameters:
        name - the name of the field
        model - the model that the field belongs to.
        highlightProvider - the HightLightStringProvider.
        displayOptions - the Options for display properties.
        fieldOptions - the Options for field specific properties.
      • FieldFactory

        public FieldFactory​(java.lang.String name)
        Constructs a FieldFactory with given name. Used only as potential field.
        Parameters:
        name - the name of the field.
    • Method Detail

      • initDisplayOptions

        protected void initDisplayOptions()
      • optionsChanged

        public void optionsChanged​(Options options,
                                   java.lang.String optionName,
                                   java.lang.Object oldValue,
                                   java.lang.Object newValue)
        Notification that the Options have changed.
        Parameters:
        options - the Options object that changed. Will be either the display options or the field options.
        optionName - the name of the property that changed.
        oldValue - the old value of the property.
        newValue - the new value of the property.
      • servicesChanged

        public void servicesChanged()
        Notification the services changed. Subclasses should override this method if they care about service changes.
      • newInstance

        public abstract FieldFactory newInstance​(FieldFormatModel formatModel,
                                                 HighlightProvider highlightProvider,
                                                 ToolOptions options,
                                                 ToolOptions fieldOptions)
        Returns a new instance of this FieldFactory that can be used to generate fields instead of being used as a prototype.
        Parameters:
        formatModel - the model that the field belongs to.
        highlightProvider - the HightLightProvider.
        options - the Options for display properties.
        fieldOptions - the Options for field specific properties.
      • displayOptionsChanged

        public void displayOptionsChanged​(Options options,
                                          java.lang.String optionName,
                                          java.lang.Object oldValue,
                                          java.lang.Object newValue)
        Notifications that the display options changed.
        Parameters:
        options - the Display Options object that changed.
        optionName - the name of the property that changed.
        oldValue - the old value of the property.
        newValue - the new value of the property.
      • fieldOptionsChanged

        public void fieldOptionsChanged​(Options options,
                                        java.lang.String optionName,
                                        java.lang.Object oldValue,
                                        java.lang.Object newValue)
        Notifications that the field options changed.
        Parameters:
        options - the Field Options object that changed.
        optionName - the name of the property that changed.
        oldValue - the old value of the property.
        newValue - the new value of the property.
      • getFieldName

        public java.lang.String getFieldName()
        Returns the Field name.
      • getDefaultColor

        public java.awt.Color getDefaultColor()
        Returns the default field color.
      • getStartX

        public int getStartX()
        Returns the starting x position for the fields generated by this factory.
      • setStartX

        public void setStartX​(int x)
        Sets the starting x position for the fields generated by this factory.
      • getWidth

        public int getWidth()
        Returns the width of the fields generated by this factory.
      • setWidth

        public void setWidth​(int w)
        Sets the width of the fields generated by this factory.
      • getFieldModel

        public FieldFormatModel getFieldModel()
        Returns the FieldModel that this factory belongs to.
      • isEnabled

        public boolean isEnabled()
        Returns true if this FieldFactory is currently enabled to generate Fields.
      • setEnabled

        public void setEnabled​(boolean state)
        Turns on or off the generating of Fields by this FieldFactory.
        Parameters:
        state - if true, this factory will generate fields.
      • getField

        public abstract ListingField getField​(ProxyObj<?> obj,
                                              int varWidth)
        Generates a Field based on the given information.
        Parameters:
        obj - The object that the generated field will report some information about.
        varWidth - the additional distance along the x axis to place the generated field.
        Returns:
        the newly generated FactoryField that shows some property or information about the given object.
      • getFieldLocation

        public abstract FieldLocation getFieldLocation​(ListingField bf,
                                                       java.math.BigInteger index,
                                                       int fieldNum,
                                                       ProgramLocation loc)
        Return a FieldLocation that corresponds to the given index, fieldNum, and ProgramLocation IF and ONLY IF the given programLocation is the type generated by this class's getFieldLocation(ListingField, BigInteger, int, ProgramLocation). Each FieldFactory should generate and process a unique ProgramLocation class.
        Parameters:
        bf - the ListingField at the current cursor.
        index - the line index (corresponds to an address)
        fieldNum - the index of field within the layout to try and get a FieldLocation.
        loc - the ProgramLocation to be converted into a FieldLocation.
      • getProgramLocation

        public abstract ProgramLocation getProgramLocation​(int row,
                                                           int col,
                                                           ListingField bf)
        Returns the Program location for the given object, row, col, and groupPath
        Parameters:
        row - the row within this field
        col - the col on the given row within this field.
        bf - the ListingField containing the cursor.
      • acceptsType

        public abstract boolean acceptsType​(int category,
                                            java.lang.Class<?> proxyObjectClass)
        Used to specify which format models this field can belong to.
        Parameters:
        category - the category for this field
        proxyObjectClass - the type of proxy object used by this field
        Returns:
        true if this class accepts the given category.
      • getFieldText

        public java.lang.String getFieldText()
        Returns a description of the fields generated by this factory.
      • getMetrics

        public java.awt.FontMetrics getMetrics()
        Returns the font metrics used by this field factory
      • getMetrics

        protected java.awt.FontMetrics getMetrics​(int fontStyle)
        Returns:
        Returns the metrics.