javafx.beans.value.ChangeListener Java Examples

The following examples show how to use javafx.beans.value.ChangeListener. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source Project: markdown-writer-fx   Author: JFormDesigner   File: MarkdownEditorPane.java    License: BSD 2-Clause "Simplified" License 6 votes vote down vote up
public void requestFocus() {
	Platform.runLater(() -> {
		if (textArea.getScene() != null)
			textArea.requestFocus();
		else {
			// text area still does not have a scene
			// --> use listener on scene to make sure that text area receives focus
			ChangeListener<Scene> l = new ChangeListener<Scene>() {
				@Override
				public void changed(ObservableValue<? extends Scene> observable, Scene oldValue, Scene newValue) {
					textArea.sceneProperty().removeListener(this);
					textArea.requestFocus();
				}
			};
			textArea.sceneProperty().addListener(l);
		}
	});
}
 
Example #2
Source Project: MyBox   Author: Mararsh   File: FxmlControl.java    License: Apache License 2.0 6 votes vote down vote up
public static void setPathValidation(final TextField input) {
    if (input == null) {
        return;
    }
    input.textProperty().addListener(new ChangeListener<String>() {
        @Override
        public void changed(ObservableValue<? extends String> observable,
                String oldValue, String newValue) {
            final File file = new File(newValue);
            if (!file.isDirectory()) {
                input.setStyle(badStyle);
                return;
            }
            input.setStyle(null);
        }
    });
}
 
Example #3
Source Project: training   Author: victorrentea   File: SpriteView.java    License: MIT License 6 votes vote down vote up
public SpriteView(Image spriteSheet, Main.Location loc) {
    imageView = new ImageView(spriteSheet);
    this.location.set(loc);
    setTranslateX(loc.getX() * Main.CELL_SIZE);
    setTranslateY(loc.getY() * Main.CELL_SIZE);
    ChangeListener<Object> updateImage = (ov, o, o2) -> imageView.setViewport(
        new Rectangle2D(frame.get() * spriteWidth,
            direction.get().getOffset() * spriteHeight,
            spriteWidth, spriteHeight));
    direction.addListener(updateImage);
    frame.addListener(updateImage);
    spriteWidth = (int) (spriteSheet.getWidth() / 3);
    spriteHeight = (int) (spriteSheet.getHeight() / 4);
    direction.set(Main.Direction.RIGHT);
    getChildren().add(imageView);
}
 
Example #4
Source Project: MyBox   Author: Mararsh   File: ImageManufactureEnhancementController.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void initControls() {
    try {
        super.initControls();
        myPane = enhancementPane;

        enhancementGroup.selectedToggleProperty().addListener(new ChangeListener<Toggle>() {
            @Override
            public void changed(ObservableValue ov, Toggle oldValue, Toggle newValue) {
                checkEnhanceType();
            }
        });

        manageView = new ImageView();

    } catch (Exception e) {
        logger.error(e.toString());
    }

}
 
Example #5
Source Project: marathonv5   Author: jalian-systems   File: RFXWebView.java    License: Apache License 2.0 6 votes vote down vote up
private void init(Node source) {
    WebView webview = (WebView) source;
    if (webview.getProperties().get("marathon_listener_installed") == null) {
        webview.getProperties().put("marathon_listener_installed", Boolean.TRUE);
        WebEngine webEngine = webview.getEngine();
        if (webEngine.getLoadWorker().stateProperty().get() == State.SUCCEEDED) {
            loadScript(webview);
        }
        webEngine.getLoadWorker().stateProperty().addListener(new ChangeListener<State>() {
            @Override
            public void changed(ObservableValue<? extends State> ov, State oldState, State newState) {
                if (newState == State.SUCCEEDED) {
                    loadScript(webview);
                }
            }
        });
    }
    JavaFXWebViewElement.init(source);
}
 
Example #6
Source Project: MyBox   Author: Mararsh   File: FilesMergeController.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void initTargetSection() {
    targetFileInput.textProperty().addListener(new ChangeListener<String>() {
        @Override
        public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
            try {
                targetFile = new File(newValue);
                targetFileInput.setStyle(null);
                recordFileWritten(targetFile.getParent());
            } catch (Exception e) {
                targetFile = null;
                targetFileInput.setStyle(badStyle);
            }
        }
    });

    operationBarController.openTargetButton.disableProperty().bind(Bindings.isEmpty(targetFileInput.textProperty())
            .or(targetFileInput.styleProperty().isEqualTo(badStyle))
    );

    startButton.disableProperty().bind(Bindings.isEmpty(targetFileInput.textProperty())
            .or(targetFileInput.styleProperty().isEqualTo(badStyle))
            .or(Bindings.isEmpty(tableData))
    );

}
 
Example #7
Source Project: CPUSim   Author: Colby-CPU-Sim   File: EditingStrCell.java    License: GNU General Public License v3.0 6 votes vote down vote up
/**
 * creates a text field with listeners so that that edits will be committed 
 * at the proper time
 */
protected void createTextField() {
    textField = new TextField(getString());
    textField.setMinWidth(this.getWidth() - this.getGraphicTextGap() * 2);
    textField.focusedProperty().addListener(new ChangeListener<Boolean>() {
        @Override
        public void changed(ObservableValue<? extends Boolean> arg0,
                            Boolean arg1, Boolean arg2) {
            if (!arg2) {
                commitEdit(textField.getText());
            }
        }
    });
    textField.setOnKeyPressed(new EventHandler<KeyEvent>() {
        @Override
        public void handle(KeyEvent t) {
            if (t.getCode() == KeyCode.ENTER) {
                commitEdit(textField.getText());
            } else if (t.getCode() == KeyCode.ESCAPE) {
                cancelEdit();
            }
        }
    });
}
 
Example #8
Source Project: zap-extensions   Author: zaproxy   File: BrowserPanel.java    License: Apache License 2.0 6 votes vote down vote up
private void listenToStateChangesForAdjustingPanelHeightToWebsite() {
    engine.getLoadWorker()
            .stateProperty()
            .addListener(
                    new ChangeListener<Object>() {
                        @Override
                        public void changed(
                                ObservableValue<?> observable,
                                Object oldValue,
                                Object newValue) {
                            if (State.SUCCEEDED == newValue && resizeOnLoad) {
                                resizeOnLoad = false;
                                final int height = getWebsiteHeight();
                                SwingUtilities.invokeLater(
                                        new Runnable() {
                                            @Override
                                            public void run() {
                                                setWebsiteHeight(height);
                                            }
                                        });
                            }
                        }
                    });
}
 
Example #9
Source Project: marathonv5   Author: jalian-systems   File: AddPreferenceStage.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public Parent getContentPane() {
    VBox content = new VBox();
    content.getStyleClass().add("add-preference-stage");
    content.setId("addPreferenceStage");
    FormPane form = new FormPane("add-preference-stage-form", 3);
    integerValueField.textProperty().addListener(new ChangeListener<String>() {
        @Override
        public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
            if (!newValue.matches("\\d*")) {
                integerValueField.setText(newValue.replaceAll("[^\\d]", ""));
            }
        }
    });
    StackPane pane = new StackPane(stringValueField, integerValueField, booleanValueField);
    pane.setAlignment(Pos.CENTER_LEFT);
    //@formatter:off
    form.addFormField("Property name:", nameField)
        .addFormField("Method:", typeComboBox, new Region())
        .addFormField("Value:", pane);
    //@formatter:on
    GridPane.setHgrow(typeComboBox, Priority.NEVER);
    VBox.setVgrow(form, Priority.ALWAYS);
    content.getChildren().addAll(form, buttonBar);
    return content;
}
 
Example #10
Source Project: PeerWasp   Author: PeerWasp   File: RecoverFileController.java    License: MIT License 6 votes vote down vote up
private void initializeStatusBar() {
	statusBar = new StatusBar();
	pane.getChildren().add(statusBar);
	AnchorPane.setBottomAnchor(statusBar, 0.0);
	AnchorPane.setLeftAnchor(statusBar, 0.0);
	AnchorPane.setRightAnchor(statusBar, 0.0);
	busyProperty.addListener(new ChangeListener<Boolean>() {
		@Override
		public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue,
				Boolean newValue) {
			if(newValue != null && newValue.booleanValue()) {
				statusBar.setProgress(-1);
			} else {
				statusBar.setProgress(0);
			}
		}
	});

	statusBar.textProperty().bind(statusProperty);
}
 
Example #11
Source Project: MyBox   Author: Mararsh   File: ImageAnalyseController.java    License: Apache License 2.0 6 votes vote down vote up
public void initImageBox() {
    try {

        imageBox.disableProperty().bind(imageView.imageProperty().isNull());

        selectAreaCheck.selectedProperty().addListener(new ChangeListener<Boolean>() {
            @Override
            public void changed(ObservableValue ov, Boolean oldValue, Boolean newValue) {
                loadData(true, true, true);
            }
        });
        selectAreaCheck.setSelected(false);

    } catch (Exception e) {
        logger.error(e.toString());
    }
}
 
Example #12
Source Project: JFoenix   Author: jfoenixadmin   File: GenericEditableTreeTableCell.java    License: Apache License 2.0 6 votes vote down vote up
private void createEditorNode() {
    EventHandler<KeyEvent> keyEventsHandler = t -> {
        if (t.getCode() == KeyCode.ENTER) {
            commitHelper(false);
        } else if (t.getCode() == KeyCode.ESCAPE) {
            cancelEdit();
        } else if (t.getCode() == KeyCode.TAB) {
            commitHelper(false);
            editNext(!t.isShiftDown());
        }
    };

    ChangeListener<Boolean> focusChangeListener = (observable, oldValue, newValue) -> {
        //This focus listener fires at the end of cell editing when focus is lost
        //and when enter is pressed (because that causes the text field to lose focus).
        //The problem is that if enter is pressed then cancelEdit is called before this
        //listener runs and therefore the text field has been cleaned up. If the
        //text field is null we don't commit the edit. This has the useful side effect
        //of stopping the double commit.
        if (editorNode != null && !newValue) {
            commitHelper(true);
        }
    };
    editorNode = builder.createNode(getValue(), keyEventsHandler, focusChangeListener);
}
 
Example #13
Source Project: marathonv5   Author: jalian-systems   File: JavaFXWebViewElement.java    License: Apache License 2.0 6 votes vote down vote up
public static void init(Node source) {
    WebView webview = (WebView) source;
    if (webview.getProperties().get("marathon_player_installed") == null) {
        webview.getProperties().put("marathon_player_installed", Boolean.TRUE);
        WebEngine webEngine = webview.getEngine();
        if (webEngine.getLoadWorker().stateProperty().get() == State.SUCCEEDED) {
            loadScript(webview, webEngine);
        }
        webEngine.getLoadWorker().stateProperty().addListener(new ChangeListener<State>() {
            @Override
            public void changed(ObservableValue<? extends State> ov, State oldState, State newState) {
                if (newState == State.SUCCEEDED) {
                    loadScript(webview, webEngine);
                }
            }
        });
    }
}
 
Example #14
Source Project: MyBox   Author: Mararsh   File: FileFilterController.java    License: Apache License 2.0 6 votes vote down vote up
@Override
public void initializeNext() {
    try {
        initFilterTab();

        filterTypeSelector.getItems().clear();
        for (StringFilterType type : StringFilterType.values()) {
            filterTypeSelector.getItems().add(message(type.name()));
        }
        filterTypeSelector.valueProperty().addListener(new ChangeListener<String>() {
            @Override
            public void changed(ObservableValue<? extends String> ov,
                    String oldv, String newv) {
                checkFilterType();
            }
        });
        filterTypeSelector.getSelectionModel().select(0);

        FxmlControl.setTooltip(filterTypeSelector, new Tooltip(AppVariables.message("FilterTypesComments")));

    } catch (Exception e) {
        logger.error(e.toString());
    }
}
 
Example #15
Source Project: HealthPlus   Author: heshanera   File: LabAssistantController.java    License: Apache License 2.0 6 votes vote down vote up
public void addFocusListener()
{        
    labPassword.focusedProperty().addListener(new ChangeListener<Boolean>()
    {
        @Override
        public void changed(ObservableValue<? extends Boolean> arg0, Boolean oldPropertyValue, Boolean newPropertyValue)
        {
            if (newPropertyValue)
            {
                System.out.println("Textfield on focus");
            }
            else
            {
                System.out.println("Textfield out focus");
            }
        }
    });
}
 
Example #16
Source Project: PreferencesFX   Author: dlsc-software-consulting-gmbh   File: History.java    License: Apache License 2.0 6 votes vote down vote up
/**
 * Adds a listener to the {@code setting}, so every time the value of the {@code setting} changes,
 * a new {@link Change} will be created and added to the list of changes.
 *
 * @param setting the setting to observe for changes
 */
public void attachChangeListener(Setting setting) {
  ChangeListener changeEvent = (observable, oldValue, newValue) -> {
    if (isListenerActive() && oldValue != newValue) {
      LOGGER.trace("Change detected, old: " + oldValue + " new: " + newValue);
      addChange(new Change(setting, oldValue, newValue));
    }
  };
  ChangeListener listChangeEvent = (observable, oldValue, newValue) -> {
    if (isListenerActive()) {
      LOGGER.trace("List Change detected: " + oldValue);
      addChange(new Change(setting, (ObservableList) oldValue, (ObservableList) newValue));
    }
  };

  if (setting.valueProperty() instanceof SimpleListProperty) {
    setting.valueProperty().addListener(listChangeEvent);
  } else {
    setting.valueProperty().addListener(changeEvent);
  }
}
 
Example #17
Source Project: fx2048   Author: brunoborges   File: GamePane.java    License: GNU General Public License v3.0 6 votes vote down vote up
public GamePane() {
    gameManager = new GameManager(UserSettings.LOCAL.getGridSize());
    gameBounds = gameManager.getLayoutBounds();

    getChildren().add(gameManager);

    getStyleClass().addAll("game-root");
    ChangeListener<Number> resize = (ov, v, v1) -> {
        double scale = Math.min((getWidth() - UserSettings.MARGIN) / gameBounds.getWidth(),
                (getHeight() - UserSettings.MARGIN) / gameBounds.getHeight());
        gameManager.setScale(scale);
        gameManager.setLayoutX((getWidth() - gameBounds.getWidth()) / 2d);
        gameManager.setLayoutY((getHeight() - gameBounds.getHeight()) / 2d);
    };
    widthProperty().addListener(resize);
    heightProperty().addListener(resize);

    addKeyHandlers();
    addSwipeHandlers();
    setFocusTraversable(true);
    setOnMouseClicked(e -> requestFocus());
}
 
Example #18
Source Project: gef   Author: eclipse   File: VisualChangeListener.java    License: Eclipse Public License 2.0 6 votes vote down vote up
/**
 * Unregisters all previously registered listeners.
 */
public void unregister() {
	if (!isRegistered()) {
		return;
	}

	// remove bounds listener
	observed.layoutBoundsProperty().removeListener(layoutBoundsListener);
	observed.boundsInLocalProperty().removeListener(boundsInLocalListener);
	observed.boundsInParentProperty()
			.removeListener(boundsInParentListener);

	// remove transform listeners
	for (ChangeListener<Transform> l : localToParentTransformListeners
			.keySet()) {
		localToParentTransformListeners.get(l)
				.localToParentTransformProperty().removeListener(l);
	}

	// reset fields
	parent = null;
	observed = null;
	localToParentTransformListeners.clear();
}
 
Example #19
Source Project: cssfx   Author: McFoggy   File: CSSFXMonitor.java    License: Apache License 2.0 6 votes vote down vote up
private void monitorStageScene(ReadOnlyObjectProperty<Scene> stageSceneProperty) {
    // first listen to changes
    stageSceneProperty.addListener(new ChangeListener<Scene>() {
        @Override
        public void changed(ObservableValue<? extends Scene> ov, Scene o, Scene n) {
            if (o != null) {
                unregisterScene(o);
            }
            if (n != null) {
                registerScene(n);
            }
        }
    });

    if (stageSceneProperty.getValue() != null) {
        registerScene(stageSceneProperty.getValue());
    }
}
 
Example #20
Source Project: markdown-writer-fx   Author: JFormDesigner   File: MainWindow.java    License: BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * Creates a boolean property that is bound to another boolean value
 * of the active editor's SmartEdit.
 */
private BooleanProperty createActiveEditBooleanProperty(Function<SmartEdit, ObservableBooleanValue> func) {
	BooleanProperty b = new SimpleBooleanProperty() {
		@Override
		public void set(boolean newValue) {
			// invoked when the user invokes an action
			// do not try to change SmartEdit properties because this
			// would throw a "bound value cannot be set" exception
		}
	};

	ChangeListener<? super FileEditor> listener = (observable, oldFileEditor, newFileEditor) -> {
		b.unbind();
		if (newFileEditor != null) {
			if (newFileEditor.getEditor() != null)
				b.bind(func.apply(newFileEditor.getEditor().getSmartEdit()));
			else {
				newFileEditor.editorProperty().addListener((ob, o, n) -> {
					b.bind(func.apply(n.getSmartEdit()));
				});
			}
		} else
			b.set(false);
	};
	FileEditor fileEditor = fileEditorTabPane.getActiveFileEditor();
	listener.changed(null, null, fileEditor);
	fileEditorTabPane.activeFileEditorProperty().addListener(listener);
	return b;
}
 
Example #21
Source Project: constellation   Author: constellation-app   File: WebViewer.java    License: Apache License 2.0 5 votes vote down vote up
private void init(final String url) {
    Platform.setImplicitExit(false);
    Platform.runLater(() -> {
        Scene scene1 = new Scene(root);
        setScene(scene1);
        WebView webView = new WebView();
        webView.setMaxWidth(Double.MAX_VALUE);
        webView.setMaxHeight(Double.MAX_VALUE);
        //                System.out.println("WEB VIEWER: " + System.identityHashCode(webView.getClass()));
        root.setCenter(webView);
        webView.setContextMenuEnabled(false);
        final WebEngine webEngine = webView.getEngine();
        webEngine.load(url);
        webEngine.locationProperty().addListener(new ChangeListener<String>() {
            @Override
            public void changed(final ObservableValue<? extends String> observable, final String oldValue, final String newValue) {
                webEngine.load(newValue);
            }
        });
        EventHandler<ActionEvent> goAction = new EventHandler<ActionEvent>() {
            @Override
            public void handle(final ActionEvent event) {
                webEngine.load(url.startsWith("http://")
                        ? url
                        : "http://" + url);
            }
        };
    });
}
 
Example #22
Source Project: Open-Lowcode   Author: openlowcode   File: ClientDisplay.java    License: Eclipse Public License 2.0 5 votes vote down vote up
/**
 * refreshes the change listener to the content holder height
 * 
 * @param newheightlistener new change listener
 */
public void setnewContentHolderHeightChangeListener(ChangeListener<Number> newheightlistener) {
	if (heightlistener != null)
		contentholder.heightProperty().removeListener(heightlistener);
	heightlistener = newheightlistener;
	contentholder.heightProperty().addListener(newheightlistener);
}
 
Example #23
Source Project: arma-dialog-creator   Author: kayler-renslow   File: FontValueEditor.java    License: MIT License 5 votes vote down vote up
public FontValueEditor() {
	btnChooseDefault.setOnAction(new EventHandler<ActionEvent>() {
		@Override
		public void handle(ActionEvent event) {
			comboBox.getSelectionModel().select(SVFont.DEFAULT);
		}
	});
	comboBox.getSelectionModel().selectedItemProperty().addListener(new ChangeListener<SVFont>() {
		@Override
		public void changed(ObservableValue<? extends SVFont> observable, SVFont oldValue, SVFont newValue) {
			valueObserver.updateValue(newValue);
		}
	});
}
 
Example #24
Source Project: gef   Author: eclipse   File: ReadOnlySetMultimapWrapper.java    License: Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void removeListener(
		ChangeListener<? super ObservableSetMultimap<K, V>> listener) {
	if (helper != null) {
		helper.removeListener(listener);
	}
}
 
Example #25
Source Project: pdfsam   Author: torakiki   File: SummaryTabTest.java    License: GNU Affero General Public License v3.0 5 votes vote down vote up
private void assertInfoIsDisplayed(List<ChangeListener<? super String>> listeners, PdfDocumentDescriptor descriptor) {
    File file = descriptor.getFile();
    List<String> values = Arrays.asList("test.producer", file.getAbsolutePath(), descriptor.getVersionString(),
            "2", "test.creationDate", "test.title", "test.author", "test.creator", "test.subject",
            FileUtils.byteCountToDisplaySize(file.length()), FORMATTER.format(file.lastModified()));
    listeners.forEach(l -> verify(l, timeout(2000).times(1)).changed(any(ObservableValue.class), anyString(),
            argThat(isIn(values))));
}
 
Example #26
Source Project: marathonv5   Author: jalian-systems   File: TextValidatorSample.java    License: Apache License 2.0 5 votes vote down vote up
public ValidatorPane() {
    content.addListener(new ChangeListener<Control>() {
        public void changed(ObservableValue<? extends Control> ov, Control oldValue, Control newValue) {
            if (oldValue != null) getChildren().remove(oldValue);
            if (newValue != null) getChildren().add(0, newValue);
        }
    });
}
 
Example #27
Source Project: diirt   Author: diirt   File: BaseGraphApp.java    License: MIT License 5 votes vote down vote up
public MessagePanel( ReadOnlyProperty< Exception > lastException ) {
    this.setCenter( lblMessage );
    this.lastException = lastException;
    this.lastException.addListener( new ChangeListener< Exception >() {

        @Override
        public void changed(ObservableValue<? extends Exception> observable, Exception oldValue, Exception newValue) {
            setMessage( newValue == null? "" : newValue.getMessage() );
        }

    });
}
 
Example #28
Source Project: pdfsam   Author: torakiki   File: KeywordsTabTest.java    License: GNU Affero General Public License v3.0 5 votes vote down vote up
@Test
public void onLoad() {
    KeywordsTab victim = new KeywordsTab();
    Labeled keywords = (Labeled) ((ScrollPane) victim.getContent()).getContent().lookup(".info-property-value");
    assertNotNull(keywords);
    ChangeListener<? super String> listener = mock(ChangeListener.class);
    keywords.textProperty().addListener(listener);
    PdfDocumentDescriptor descriptor = PdfDocumentDescriptor.newDescriptorNoPassword(mock(File.class));
    WaitForAsyncUtils.waitForAsyncFx(2000, () -> victim.requestShow(new ShowPdfDescriptorRequest(descriptor)));
    descriptor.putInformation(PdfMetadataFields.KEYWORDS, "test");
    descriptor.moveStatusTo(PdfDescriptorLoadingStatus.REQUESTED);
    descriptor.moveStatusTo(PdfDescriptorLoadingStatus.LOADING);
    descriptor.moveStatusTo(PdfDescriptorLoadingStatus.LOADED);
    verify(listener, timeout(2000).times(1)).changed(any(ObservableValue.class), anyString(), eq("test"));
}
 
Example #29
Source Project: CPUSim   Author: Colby-CPU-Sim   File: OptionsController.java    License: GNU General Public License v3.0 5 votes vote down vote up
/**
 * Initializes the indexing tab
 */
private void initializeIndexingTab() {

    changeIndexingDirection = false;

    ChangeListener indexChangeListener = new ChangeListener() {
        @Override
        public void changed(ObservableValue ov, Object t, Object t1) {
            changeIndexingDirection = !changeIndexingDirection;
        }
    };

    indexChoice.setValue(mediator.getMachine().getIndexFromRight() ? "right" : "left");
    indexChoice.getSelectionModel().selectedIndexProperty().addListener(indexChangeListener);
}
 
Example #30
Source Project: tuxguitar   Author: phiresky   File: JFXTabItem.java    License: GNU Lesser General Public License v2.1 5 votes vote down vote up
public void addChild(JFXNode<? extends Node> control) {
	final Node handle = control.getControl();
	
	this.control = control;
	this.getControl().getChildren().add(handle);
	
	ChangeListener<Number> resizeListener = new ChangeListener<Number>() {
		public void changed(ObservableValue<? extends Number> observableValue, Number oldSize, Number newSize) {
			JFXTabItem.this.onResize();
		}
	};
	this.getControl().widthProperty().addListener(resizeListener);
	this.getControl().heightProperty().addListener(resizeListener);
}