Package org.mt4j.components

Examples of org.mt4j.components.StateChangeListener


              MTComponent mtCurrentComp = (MTComponent)currentComp;
             
///////////////////////////////             
              // Listen to destroy events of the clustered components, to remove them from
              // the cluster and pack the polygon.
              mtCurrentComp.addStateChangeListener(StateChange.COMPONENT_DESTROYED, new StateChangeListener(){
                public void stateChanged(StateChangeEvent evt) {
                  if (evt.getSource() instanceof MTComponent) {
                    MTComponent sourceComp = (MTComponent) evt.getSource();
                   
                    //Remove component from cluster it is in


      }
    });
   
    //Always put last in parents children list if added to a parent,
    //so the chance is higher that this is really drawn ontop of other stuff
    this.addStateChangeListener(StateChange.ADDED_TO_PARENT, new StateChangeListener() {
      public void stateChanged(StateChangeEvent evt) {
        putLastInParentList();
      }
    });
  }

    }else{
      applet.addScene(sceneTexture.getScene())
    }
   
   
    sceneTexture.addStateChangeListener(StateChange.COMPONENT_DESTROYED, new StateChangeListener() {
      public void stateChanged(StateChangeEvent evt) {
        destroy();
      }
    });
   

  public synchronized void addClusterable(IdragClusterable selectable){
    dragSelectables.add(selectable);
    if (selectable instanceof MTComponent) {
      MTComponent baseComp = (MTComponent) selectable;

      baseComp.addStateChangeListener(StateChange.COMPONENT_DESTROYED, new StateChangeListener(){
        public void stateChanged(StateChangeEvent evt) {
          if (evt.getSource() instanceof IdragClusterable) {
            IdragClusterable clusterAble = (IdragClusterable) evt.getSource();
            removeClusterable(clusterAble);
            //logger.debug("Removed comp from clustergesture analyzers tracking");

      t.setEnableCaret(true);
      t.snapToKeyboard(this);
     
      this.addTextInputListener(this.textInputListener);
      //Remove textarea from listening if destroyed
      t.addStateChangeListener(StateChange.COMPONENT_DESTROYED, new StateChangeListener() {
        public void stateChanged(StateChangeEvent evt) {
          removeTextInputListener(t);
        }
      });
    }else{

TOP

Related Classes of org.mt4j.components.StateChangeListener

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.