use of de.gurkenlabs.litiengine.environment.tilemap.MapObjectType in project litiengine by gurkenlabs.
the class MapObjectPanel method setupChangedListeners.
private void setupChangedListeners() {
comboBoxType.addItemListener(new MapObjectPropertyItemListener(m -> {
MapObjectType type = (MapObjectType) comboBoxType.getSelectedItem();
m.setType(type.toString());
}));
comboBoxType.addItemListener(e -> {
MapObjectType type = (MapObjectType) comboBoxType.getSelectedItem();
switchPanel(type);
});
this.textFieldName.addFocusListener(new MapObjectPropteryFocusListener(m -> m.setName(textFieldName.getText())));
this.textFieldName.addActionListener(new MapObjectPropertyActionListener(m -> m.setName(textFieldName.getText())));
this.spinnerX.addChangeListener(new MapObjectPropertyChangeListener(m -> {
m.setX((int) spinnerX.getValue());
EditorScreen.instance().getMapComponent().updateTransformControls();
}));
this.spinnerY.addChangeListener(new MapObjectPropertyChangeListener(m -> {
m.setY((int) spinnerY.getValue());
EditorScreen.instance().getMapComponent().updateTransformControls();
}));
this.spinnerWidth.addChangeListener(new MapObjectPropertyChangeListener(m -> {
m.setWidth((int) spinnerWidth.getValue());
EditorScreen.instance().getMapComponent().updateTransformControls();
}));
this.spinnerHeight.addChangeListener(new MapObjectPropertyChangeListener(m -> {
m.setHeight((int) spinnerHeight.getValue());
EditorScreen.instance().getMapComponent().updateTransformControls();
}));
this.tagPanel.addActionListener(new MapObjectPropertyActionListener(m -> m.setCustomProperty(MapObjectProperty.TAGS, this.tagPanel.getTagsString())));
}
Aggregations