Ignore:
Timestamp:
10/17/12 10:50:44 (12 years ago)
Author:
fglaser
Message:
  • Title change hierarchy control added
  • JFCNameChangeListener renamed to JFCTitleChangeListener
  • JFCTitleChangeListener now additionaly listens on icon and position changes
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/autoquest-jfcmonitor/src/main/java/de/ugoe/cs/autoquest/jfcmonitor/JFCComponent.java

    r927 r928  
    142142     * @param component 
    143143     *            component that is searched for 
    144      * @return corresponding JFComponent instance; null if the compenent is not found 
     144     * @return corresponding JFComponent instance; null if the component is not found 
    145145     */ 
    146146    public static JFCComponent find(Component component) { 
     
    192192     */ 
    193193    private String title = null; 
     194     
     195    /** 
     196     * <p> 
     197     * Helper attribute that encodes the source of the title. 
     198     * </p> 
     199     */ 
     200    private int titleSource = JFCComponentTitleHierachy.SOURCE_NOT_KNOWN; 
    194201 
    195202    /** 
     
    303310    /** 
    304311     * <p> 
     312     * Returns an integer that encodes the source of the title. 
     313     * </p> 
     314     * @return int 
     315     */ 
     316    public int getTitleSource(){ 
     317        return titleSource; 
     318    } 
     319     
     320    /** 
     321     * <p> 
    305322     * Returns an XML representation of the components children. 
    306323     * </p> 
     
    363380     * </p> 
    364381     */ 
    365     private void setTitle() { 
     382    public void setTitle() { 
     383        // Note that JFCComponentTitleHierarchy depends on this method. So any changes made 
     384        // here should be reflected in JFCComponentTitleHierarchy. 
     385         
    366386        title = null; // reset title 
    367387 
     
    369389        if (accessibleContext != null) { 
    370390            title = accessibleContext.getAccessibleName(); 
     391            titleSource = JFCComponentTitleHierachy.ACCESSIBLE_NAME; 
    371392        } 
    372393        if (title == null) { 
    373394            title = icon; 
     395            titleSource = JFCComponentTitleHierachy.ICON; 
    374396        } 
    375397        if (title == null) { 
    376398            title = component.getName(); 
     399            titleSource = JFCComponentTitleHierachy.NAME; 
    377400        } 
    378401        if (title == null) { 
    379402            // use coordinates as last resort 
    380403            title = "Pos(" + component.getX() + "," + component.getY() + ")"; 
     404            titleSource = JFCComponentTitleHierachy.POS; 
    381405        } 
    382406    } 
Note: See TracChangeset for help on using the changeset viewer.