Huge refactoring of codebase to support latest version of Java PureMVC (v2.2)
This commit is contained in:
@@ -10,8 +10,8 @@ import com.badlogic.gdx.utils.Align;
|
||||
import com.kotcrab.vis.ui.widget.VisLabel;
|
||||
import com.kotcrab.vis.ui.widget.VisTable;
|
||||
import com.kotcrab.vis.ui.widget.VisTextButton;
|
||||
import com.puremvc.patterns.facade.SimpleFacade;
|
||||
import games.rednblack.h2d.common.H2DDialog;
|
||||
import org.puremvc.java.interfaces.IFacade;
|
||||
|
||||
/**
|
||||
* Created by azakhary on 8/18/2015.
|
||||
@@ -21,7 +21,7 @@ public class MainPanel extends H2DDialog {
|
||||
|
||||
public static final String SAVE_CLICKED = CLASS_NAME + ".SAVE_CLICKED";
|
||||
|
||||
private SimpleFacade facade;
|
||||
private IFacade facade;
|
||||
|
||||
private VisTable mainTable;
|
||||
private TextureRegion texture;
|
||||
@@ -32,11 +32,11 @@ public class MainPanel extends H2DDialog {
|
||||
private EditingZone editingZone;
|
||||
private PreviewWidget previewWidget;
|
||||
|
||||
public MainPanel() {
|
||||
public MainPanel(IFacade facade) {
|
||||
super("Nine Patch");
|
||||
addCloseButton();
|
||||
|
||||
facade = SimpleFacade.getInstance();
|
||||
this.facade = facade;
|
||||
|
||||
mainTable = new VisTable();
|
||||
add(mainTable).width(520).height(310).padBottom(7);
|
||||
|
||||
+5
-5
@@ -5,13 +5,13 @@ import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.files.FileHandle;
|
||||
import com.badlogic.gdx.graphics.g2d.NinePatch;
|
||||
import com.badlogic.gdx.graphics.g2d.TextureAtlas;
|
||||
import com.puremvc.patterns.mediator.SimpleMediator;
|
||||
import com.puremvc.patterns.observer.Notification;
|
||||
import games.rednblack.editor.renderer.components.MainItemComponent;
|
||||
import games.rednblack.editor.renderer.components.NinePatchComponent;
|
||||
import games.rednblack.editor.renderer.components.TextureRegionComponent;
|
||||
import games.rednblack.editor.renderer.factory.EntityFactory;
|
||||
import games.rednblack.editor.renderer.utils.ComponentRetriever;
|
||||
import org.puremvc.java.interfaces.INotification;
|
||||
import org.puremvc.java.patterns.mediator.Mediator;
|
||||
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.BufferedWriter;
|
||||
@@ -22,7 +22,7 @@ import java.io.IOException;
|
||||
/**
|
||||
* Created by azakhary on 8/18/2015.
|
||||
*/
|
||||
public class MainPanelMediator extends SimpleMediator<MainPanel> {
|
||||
public class MainPanelMediator extends Mediator<MainPanel> {
|
||||
private static final String TAG = MainPanelMediator.class.getCanonicalName();
|
||||
public static final String NAME = TAG;
|
||||
|
||||
@@ -31,7 +31,7 @@ public class MainPanelMediator extends SimpleMediator<MainPanel> {
|
||||
private ImageUtils imageUtils = new ImageUtils();
|
||||
|
||||
public MainPanelMediator(NinePatchPlugin plugin) {
|
||||
super(NAME, new MainPanel());
|
||||
super(NAME, new MainPanel(plugin.facade));
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public class MainPanelMediator extends SimpleMediator<MainPanel> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleNotification(Notification notification) {
|
||||
public void handleNotification(INotification notification) {
|
||||
super.handleNotification(notification);
|
||||
switch (notification.getName()) {
|
||||
case NinePatchPlugin.EDIT_NINE_PATCH:
|
||||
|
||||
+1
-1
@@ -27,11 +27,11 @@ public class NinePatchPlugin extends H2DPluginAdapter {
|
||||
|
||||
public NinePatchPlugin() {
|
||||
super(CLASS_NAME);
|
||||
performancePanelMediator = new MainPanelMediator(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initPlugin() {
|
||||
performancePanelMediator = new MainPanelMediator(this);
|
||||
facade.registerMediator(performancePanelMediator);
|
||||
pluginAPI.setDropDownItemName(EDIT_NINE_PATCH, "Edit NinePatch");
|
||||
pluginAPI.setDropDownItemName(CONVERT_TO_NINE_PATCH, "Convert to NinePatch");
|
||||
|
||||
Reference in New Issue
Block a user