From 4f4827b517d7aaff9c99df41bf11a556e63009d8 Mon Sep 17 00:00:00 2001 From: SusanRatiLane Date: Thu, 26 Sep 2024 14:11:13 -0400 Subject: [PATCH] Clean up code --- .../client/editor/blocks/BlocksEditor.java | 6 +-- .../editor/designer/DesignerEditor.java | 4 +- .../simple/SimpleVisibleComponentsPanel.java | 13 ----- .../editor/youngandroid/YaBlocksEditor.java | 22 ++++---- .../editor/youngandroid/YaFormEditor.java | 28 ++++------ .../editor/youngandroid/YaProjectEditor.java | 53 ++++++------------- .../YaVisibleComponentsPanel.java | 19 +------ .../client/style/neo/UiFactoryNeo.java | 3 -- .../neo/YaVisibleComponentsPanelNeo.java | 4 -- 9 files changed, 45 insertions(+), 107 deletions(-) diff --git a/appinventor/appengine/src/com/google/appinventor/client/editor/blocks/BlocksEditor.java b/appinventor/appengine/src/com/google/appinventor/client/editor/blocks/BlocksEditor.java index 6259117ba6..46a5f9de9d 100644 --- a/appinventor/appengine/src/com/google/appinventor/client/editor/blocks/BlocksEditor.java +++ b/appinventor/appengine/src/com/google/appinventor/client/editor/blocks/BlocksEditor.java @@ -59,7 +59,7 @@ public abstract class BlocksEditor componentUuids = new HashSet(); + private final Set componentUuids = new HashSet<>(); // Keep a map from projectid_formname -> YaBlocksEditor for handling blocks workspace changed // callbacks from the BlocklyPanel objects. This has to be static because it is used by // static methods that are called from the Javascript Blockly world. - private static Map> formToBlocksEditor = new HashMap>(); + private final static Map> formToBlocksEditor = new HashMap<>(); /** * Creates a {@code FileEditor} instance. diff --git a/appinventor/appengine/src/com/google/appinventor/client/editor/designer/DesignerEditor.java b/appinventor/appengine/src/com/google/appinventor/client/editor/designer/DesignerEditor.java index 9d9593fb3c..268dff59fc 100644 --- a/appinventor/appengine/src/com/google/appinventor/client/editor/designer/DesignerEditor.java +++ b/appinventor/appengine/src/com/google/appinventor/client/editor/designer/DesignerEditor.java @@ -446,7 +446,7 @@ public final String getEditorType() { * Show the given component's properties in the properties panel. */ protected void updatePropertiesPanel(List components, boolean selected) { - if (components == null || components.size() == 0) { + if (components.isEmpty()) { throw new IllegalArgumentException("components must be a list of at least 1"); } if (selectedProperties != null) { @@ -472,7 +472,7 @@ protected void updatePropertiesPanel(List components, boolean sel properties.add(propertyName + ":" + property.getType()); } } - if (properties.size() > 0) { + if (!properties.isEmpty()) { propertyMaps.keySet().retainAll(properties); } first = false; diff --git a/appinventor/appengine/src/com/google/appinventor/client/editor/simple/SimpleVisibleComponentsPanel.java b/appinventor/appengine/src/com/google/appinventor/client/editor/simple/SimpleVisibleComponentsPanel.java index 0b8c9eb797..6f5eec197a 100644 --- a/appinventor/appengine/src/com/google/appinventor/client/editor/simple/SimpleVisibleComponentsPanel.java +++ b/appinventor/appengine/src/com/google/appinventor/client/editor/simple/SimpleVisibleComponentsPanel.java @@ -8,32 +8,19 @@ import com.google.appinventor.client.Ode; import com.google.appinventor.client.editor.simple.components.MockForm; -import com.google.gwt.core.client.GWT; -import com.google.gwt.event.dom.client.ChangeEvent; -import com.google.gwt.event.dom.client.ChangeHandler; import com.google.appinventor.client.editor.ProjectEditor; import com.google.appinventor.client.editor.designer.DesignerRootComponent; import com.google.appinventor.client.editor.simple.palette.SimplePaletteItem; import com.google.appinventor.client.widgets.dnd.DragSource; import com.google.appinventor.client.widgets.dnd.DropTarget; import com.google.appinventor.shared.simple.ComponentDatabaseChangeListener; -import com.google.gwt.event.dom.client.ChangeEvent; -import com.google.gwt.event.dom.client.ChangeHandler; -import com.google.appinventor.shared.settings.SettingsConstants; - -import com.google.gwt.uibinder.client.UiBinder; -import com.google.gwt.uibinder.client.UiField; import com.google.gwt.user.client.ui.Composite; -import com.google.gwt.user.client.ui.VerticalPanel; import com.google.gwt.user.client.ui.Widget; -import com.google.gwt.user.client.ui.ListBox; import java.util.List; import java.util.Map; import java.util.logging.Logger; -import static com.google.appinventor.client.Ode.MESSAGES; - /** * Panel in the Simple design editor holding visible Simple components. * diff --git a/appinventor/appengine/src/com/google/appinventor/client/editor/youngandroid/YaBlocksEditor.java b/appinventor/appengine/src/com/google/appinventor/client/editor/youngandroid/YaBlocksEditor.java index 8cddbdb622..3a0748da0f 100644 --- a/appinventor/appengine/src/com/google/appinventor/client/editor/youngandroid/YaBlocksEditor.java +++ b/appinventor/appengine/src/com/google/appinventor/client/editor/youngandroid/YaBlocksEditor.java @@ -63,7 +63,7 @@ public final class YaBlocksEditor extends BlocksEditor getBlockTypeSet() { - Set blockTypes = new HashSet(); + Set blockTypes = new HashSet<>(); String xmlString = blocksArea.getBlocksContent(); Document blockDoc = XMLParser.parse(xmlString); NodeList blockElements = blockDoc.getElementsByTagName("block"); @@ -160,21 +160,24 @@ public HashMap> getComponentBlockTypeSet(HashMap blockTypes = componentBlocks.get(component_type) == null ? new HashSet() : componentBlocks.get(component_type); + Set blockTypes = componentBlocks.get(component_type) == null + ? new HashSet<>() : componentBlocks.get(component_type); blockTypes.add(event_name); componentBlocks.put(component_type, blockTypes); } else if ("component_method".equals(blockType)) { Element mutElem = (Element) blockElem.getElementsByTagName("mutation").item(0); String component_type = mutElem.getAttribute("component_type"); String method_name = mutElem.getAttribute("method_name"); - Set blockTypes = componentBlocks.get(component_type) == null ? new HashSet() : componentBlocks.get(component_type); + Set blockTypes = componentBlocks.get(component_type) == null + ? new HashSet<>() : componentBlocks.get(component_type); blockTypes.add(method_name); componentBlocks.put(component_type, blockTypes); } else if ("component_set_get".equals(blockType)) { Element mutElem = (Element) blockElem.getElementsByTagName("mutation").item(0); String component_type = mutElem.getAttribute("component_type"); String property_name = mutElem.getAttribute("property_name"); - Set blockTypes = componentBlocks.get(component_type) == null ? new HashSet() : componentBlocks.get(component_type); + Set blockTypes = componentBlocks.get(component_type) == null + ? new HashSet<>() : componentBlocks.get(component_type); blockTypes.add(property_name); componentBlocks.put(component_type, blockTypes); } @@ -205,7 +208,7 @@ private static String packageNameFromPath(String path) { } public MockForm getForm() { - YaProjectEditor yaProjectEditor = (YaProjectEditor) projectEditor; + YaProjectEditor yaProjectEditor = projectEditor; YaFormEditor myFormEditor = (YaFormEditor) yaProjectEditor.getFormFileEditor(blocksNode.getFormName()); if (myFormEditor != null) { return myFormEditor.getForm(); @@ -254,7 +257,7 @@ public void onProjectLoaded(Project project) { YoungAndroidAssetsFolder assetsFolder = ((YoungAndroidProjectNode) project.getRootNode()) .getAssetsFolder(); for (ProjectNode node : assetsFolder.getChildren()) { - blocksArea.addAsset(((YoungAndroidAssetNode) node).getName()); + blocksArea.addAsset(node.getName()); } } @@ -263,17 +266,16 @@ public void onProjectNodeAdded(Project project, ProjectNode node) { if (node instanceof YoungAndroidSourceNode) { blocksArea.addScreen(((YoungAndroidSourceNode) node).getFormName()); } else if (node instanceof YoungAndroidAssetNode) { - blocksArea.addAsset(((YoungAndroidAssetNode) node).getName()); + blocksArea.addAsset(node.getName()); } } - @Override public void onProjectNodeRemoved(Project project, ProjectNode node) { if (node instanceof YoungAndroidSourceNode) { blocksArea.removeScreen(((YoungAndroidSourceNode) node).getFormName()); } else if (node instanceof YoungAndroidAssetNode) { - blocksArea.removeAsset(((YoungAndroidAssetNode) node).getName()); + blocksArea.removeAsset(node.getName()); } } diff --git a/appinventor/appengine/src/com/google/appinventor/client/editor/youngandroid/YaFormEditor.java b/appinventor/appengine/src/com/google/appinventor/client/editor/youngandroid/YaFormEditor.java index 3ff97cace3..028d8441aa 100644 --- a/appinventor/appengine/src/com/google/appinventor/client/editor/youngandroid/YaFormEditor.java +++ b/appinventor/appengine/src/com/google/appinventor/client/editor/youngandroid/YaFormEditor.java @@ -12,12 +12,10 @@ import com.google.appinventor.client.Ode; import com.google.appinventor.client.OdeAsyncCallback; import com.google.appinventor.client.boxes.PaletteBox; -import com.google.appinventor.client.boxes.PropertiesBox; import com.google.appinventor.client.editor.ProjectEditor; import com.google.appinventor.client.editor.designer.DesignerEditor; import com.google.appinventor.client.editor.simple.ComponentNotFoundException; import com.google.appinventor.client.editor.simple.SimpleComponentDatabase; -import com.google.appinventor.client.editor.simple.SimpleNonVisibleComponentsPanel; import com.google.appinventor.client.editor.simple.components.MockComponent; import com.google.appinventor.client.editor.simple.components.MockContainer; import com.google.appinventor.client.editor.simple.components.MockForm; @@ -83,11 +81,6 @@ public final class YaFormEditor extends DesignerEditor componentsDb = new HashMap<>(); - private static final int OLD_PROJECT_YAV = 150; // Projects older then this have no authURL /** @@ -333,7 +326,7 @@ protected void onFileLoaded(String content) { root.select(null); String subsetjson = root.getPropertyValue(SettingsConstants.YOUNG_ANDROID_SETTINGS_BLOCK_SUBSET); - if (subsetjson.length() > 0) { + if (!subsetjson.isEmpty()) { reloadComponentPalette(subsetjson); } super.onFileLoaded(content); @@ -348,17 +341,16 @@ protected void onFileLoaded(String content) { root.addDesignerChangeListener(this); // Also have the blocks editor listen to changes. Do this here instead // of in the blocks editor so that we don't risk it missing any updates. - root.addDesignerChangeListener(((YaProjectEditor) projectEditor) - .getBlocksFileEditor(root.getName())); + root.addDesignerChangeListener(projectEditor.getBlocksFileEditor(root.getName())); } public void reloadComponentPalette(String subsetjson) { Set shownComponents = new HashSet(); - if (subsetjson.length() > 0) { + if (!subsetjson.isEmpty()) { try { String shownComponentsStr = getShownComponents(subsetjson); - if (shownComponentsStr.length() > 0) { - shownComponents = new HashSet(Arrays.asList(shownComponentsStr.split(","))); + if (!shownComponentsStr.isEmpty()) { + shownComponents = new HashSet<>(Arrays.asList(shownComponentsStr.split(","))); } palettePanel.reloadComponentsFromSet(shownComponents); } catch (Exception e) { @@ -407,7 +399,7 @@ public void getBlocksImage(Callback callback) { */ protected void loadDesigner() { root.refresh(); - MockComponent selectedComponent = root.getLastSelectedComponent(); +// MockComponent selectedComponent = root.getLastSelectedComponent(); // Set the palette box's content. PaletteBox paletteBox = PaletteBox.getPaletteBox(); @@ -470,7 +462,7 @@ private void encodeComponentProperties(MockComponent component, StringBuilder sb // // NOTE: It is important that these be encoded before any children components. String propertiesString = properties.encodeAsPairs(forYail); - if (propertiesString.length() > 0) { + if (!propertiesString.isEmpty()) { sb.append(','); sb.append(propertiesString); } @@ -533,7 +525,7 @@ public void onComponentTypeAdded(List componentTypes) { @Override public boolean beforeComponentTypeRemoved(List componentTypes) { boolean result = super.beforeComponentTypeRemoved(componentTypes); - List mockComponents = new ArrayList(getForm().getChildren()); + List mockComponents = new ArrayList<>(getForm().getChildren()); for (String compType : componentTypes) { for (MockComponent mockComp : mockComponents) { if (mockComp.getType().equals(compType)) { @@ -634,7 +626,7 @@ private native JsArrayString concat(JsArrayString first, JsArrayString second)/* }-*/; private YaBlocksEditor getBlocksEditor() { - return (YaBlocksEditor) ((YaProjectEditor) projectEditor).getBlocksFileEditor(sourceNode.getFormName()); + return (YaBlocksEditor) projectEditor.getBlocksFileEditor(sourceNode.getFormName()); } private JsArrayString getSelectedComponentBlocks() { @@ -651,7 +643,7 @@ private JsArrayString getSelectedComponentBlocks(MockComponent component, YaBlocksEditor blocksEditor) { JsArrayString blocks = blocksEditor.getTopBlocksForComponentByName(component.getName()); if (component instanceof MockContainer) { - for (MockComponent child : ((MockContainer) component).getChildren()) { + for (MockComponent child : component.getChildren()) { JsArrayString childBlocks = getSelectedComponentBlocks(child, blocksEditor); for (int i = 0; i < childBlocks.length(); i++) { blocks.push(childBlocks.get(i)); diff --git a/appinventor/appengine/src/com/google/appinventor/client/editor/youngandroid/YaProjectEditor.java b/appinventor/appengine/src/com/google/appinventor/client/editor/youngandroid/YaProjectEditor.java index 7f97381816..2dc63b1c9f 100644 --- a/appinventor/appengine/src/com/google/appinventor/client/editor/youngandroid/YaProjectEditor.java +++ b/appinventor/appengine/src/com/google/appinventor/client/editor/youngandroid/YaProjectEditor.java @@ -16,7 +16,6 @@ import com.google.appinventor.client.editor.EditorManager; import com.google.appinventor.client.editor.FileEditor; import com.google.appinventor.client.editor.ProjectEditor; -import com.google.appinventor.client.editor.ProjectEditorFactory; import com.google.appinventor.client.editor.blocks.BlocksEditor; import com.google.appinventor.client.editor.designer.DesignerEditor; import com.google.appinventor.client.editor.simple.SimpleComponentDatabase; @@ -35,7 +34,6 @@ import com.google.appinventor.shared.rpc.project.ChecksumedLoadFile; import com.google.appinventor.shared.rpc.project.ProjectNode; import com.google.appinventor.shared.rpc.project.ProjectRootNode; -import com.google.appinventor.shared.rpc.project.SourceNode; import com.google.appinventor.shared.rpc.project.youngandroid.YoungAndroidBlocksNode; import com.google.appinventor.shared.rpc.project.youngandroid.YoungAndroidComponentsFolder; import com.google.appinventor.shared.rpc.project.youngandroid.YoungAndroidFormNode; @@ -91,8 +89,8 @@ interface CombinedUi extends UiBinder {} // blocks representation of the program logic. Some day it may also have an // editor for the textual representation of the program logic. private static class EditorSet { - DesignerEditor formEditor = null; - BlocksEditor blocksEditor = null; + YaFormEditor formEditor = null; + YaBlocksEditor blocksEditor = null; } // Maps form name -> editors for this form @@ -159,8 +157,7 @@ private void loadBlocksEditor(String formName) { } loadedBlocksEditors.add(formName); - final BlocksEditor> newBlocksEditor = - (BlocksEditor) editorMap.get(formName).blocksEditor; + final YaBlocksEditor newBlocksEditor = editorMap.get(formName).blocksEditor; newBlocksEditor.setDesigner(editorMap.get(formName).formEditor); newBlocksEditor.loadFile(new Command() { @Override @@ -183,24 +180,6 @@ public void execute() { }); } - public void addBlocksEditor(BlocksEditor editor) { - String formName = editor.getEntityName(); - int pos = Collections.binarySearch(fileIds, editor.getFileId(), - getFileIdComparator()); - if (pos < 0) { - pos = -pos - 1; - } - insertFileEditor(editor, pos); - if (isLastOpened(((SourceNode) editor.getFileNode()).getPrefixedEntityName())) { - screen1BlocksLoaded = true; - if (readyToShowScreen1()) { - Ode.CLog("YaProjectEditor.addBlocksEditor.loadFile.execute: switching to screen " - + formName + " for project " + editor.getProjectId()); - Ode.getInstance().getDesignToolbar().switchToScreen(editor.getProjectId(), - formName, DesignToolbar.View.DESIGNER); - } - } } - /** * Project process is completed before loadProject is started! * Currently Project process loads all External Components into Component Database @@ -350,7 +329,7 @@ public void onProjectNodeRemoved(Project project, ProjectNode node) { // removed, calling DesignToolbar.removeScreen a second time will be a no-op. LOG.info("YaProjectEditor: got onProjectNodeRemoved for project " + project.getProjectId() + ", node " + node.getFileId()); - String formName = null; + String formName; // Screen Editorss if (node instanceof YoungAndroidFormNode) { formName = ((YoungAndroidFormNode) node).getFormName(); @@ -386,7 +365,7 @@ else if (node instanceof YoungAndroidBlocksNode) { * @return a list of component instance names */ public List getComponentInstances(String formName) { - List components = new ArrayList(); + List components = new ArrayList<>(); EditorSet editorSet = editorMap.get(formName); if (editorSet == null) { return components; @@ -396,7 +375,7 @@ public List getComponentInstances(String formName) { } public List getComponentInstances() { - List components = new ArrayList(); + List components = new ArrayList<>(); for (String formName : editorMap.keySet()) { components.addAll(getComponentInstances(formName)); } @@ -404,7 +383,7 @@ public List getComponentInstances() { } public Set getComponentTypes(String formName) { - Set types = new HashSet(); + Set types = new HashSet<>(); EditorSet editorSet = editorMap.get(formName); if (editorSet == null) { return types; @@ -416,7 +395,7 @@ public Set getComponentTypes(String formName) { } public Set getUniqueComponentTypes() { - Set types = new HashSet(); + Set types = new HashSet<>(); for (String formName : editorMap.keySet()) { types.addAll(getComponentTypes(formName)); } @@ -424,7 +403,7 @@ public Set getUniqueComponentTypes() { } public Set getUniqueBuiltInBlockTypes() { - Set types = new HashSet(); + Set types = new HashSet<>(); for (EditorSet ed : editorMap.values()) { types.addAll(ed.blocksEditor.getBlockTypeSet()); } @@ -434,7 +413,7 @@ public Set getUniqueBuiltInBlockTypes() { // Returns a hash of component names with the set of all component blocks (events, methods, // and properties) in use for all screens in the current project public HashMap> getUniqueComponentBlockTypes() { - HashMap> componentBlocks = new HashMap>(); + HashMap> componentBlocks = new HashMap<>(); for (EditorSet ed : editorMap.values()) { componentBlocks = ed.blocksEditor.getComponentBlockTypeSet(componentBlocks); } @@ -489,7 +468,7 @@ public int compare(String fileId1, String fileId2) { }; } - private void addDesigner(final String entityName, final DesignerEditor newDesigner) { + private void addDesigner(final String entityName, YaFormEditor newDesigner) { if (editorMap.containsKey(entityName)) { // This happens if the blocks editor was already added. editorMap.get(entityName).formEditor = newDesigner; @@ -543,7 +522,7 @@ private boolean readyToShowScreen1() { return screen1FormLoaded && screen1BlocksLoaded && screen1Added; } - private void addBlocksEditor(String entityName, final BlocksEditor newBlocksEditor) { + private void addBlocksEditor(String entityName, final YaBlocksEditor newBlocksEditor) { if (editorMap.containsKey(entityName)) { // This happens if the form editor was already added. editorMap.get(entityName).blocksEditor = newBlocksEditor; @@ -640,12 +619,12 @@ public Promise importExtension(final ProjectNode node) { // group new extensions by package name String packageName = name.substring(0, name.lastIndexOf('.')); if (!externalCollections.containsKey(packageName)) { - externalCollections.put(packageName, new HashSet()); + externalCollections.put(packageName, new HashSet<>()); } externalCollections.get(packageName).add(name); if (!extensionsInNode.containsKey(fileId)) { - extensionsInNode.put(fileId, new HashSet()); + extensionsInNode.put(fileId, new HashSet<>()); } extensionsInNode.get(fileId).add(name); extensionToNodeName.put(name, fileId); @@ -688,7 +667,7 @@ public Promise importExtension(final ProjectNode node) { public void removeComponent(Map componentTypes) { final Ode ode = Ode.getInstance(); final YoungAndroidComponentsFolder componentsFolder = ((YoungAndroidProjectNode) project.getRootNode()).getComponentsFolder(); - Set externalCompFolders = new HashSet(); + Set externalCompFolders = new HashSet<>(); // Old projects with old extensions will use FQCN for the directory name rather than the package // Prefer deleting com.foo.Bar over com.foo if com.foo.Bar exists. for (ProjectNode child : componentsFolder.getChildren()) { @@ -697,7 +676,7 @@ public void removeComponent(Map componentTypes) { externalCompFolders.add(parts[2]); } } - Set removedPackages = new HashSet(); + Set removedPackages = new HashSet<>(); for (String componentType : componentTypes.keySet()) { String typeName = componentTypes.get(componentType); if (!externalCompFolders.contains(typeName) && !externalComponents.contains(typeName)) { diff --git a/appinventor/appengine/src/com/google/appinventor/client/editor/youngandroid/YaVisibleComponentsPanel.java b/appinventor/appengine/src/com/google/appinventor/client/editor/youngandroid/YaVisibleComponentsPanel.java index ee0c7ad31a..706dae3efe 100644 --- a/appinventor/appengine/src/com/google/appinventor/client/editor/youngandroid/YaVisibleComponentsPanel.java +++ b/appinventor/appengine/src/com/google/appinventor/client/editor/youngandroid/YaVisibleComponentsPanel.java @@ -4,23 +4,17 @@ package com.google.appinventor.client.editor.youngandroid; import com.google.appinventor.client.editor.ProjectEditor; -import com.google.appinventor.client.editor.simple.SimpleNonVisibleComponentsPanel; import com.google.appinventor.client.editor.simple.SimpleVisibleComponentsPanel; import com.google.appinventor.client.editor.simple.components.MockForm; import com.google.appinventor.shared.settings.SettingsConstants; import com.google.gwt.core.client.GWT; import com.google.gwt.event.dom.client.ChangeEvent; import com.google.gwt.event.dom.client.ChangeHandler; -import com.google.gwt.event.logical.shared.ValueChangeEvent; -import com.google.gwt.event.logical.shared.ValueChangeHandler; import com.google.gwt.uibinder.client.UiBinder; import com.google.gwt.uibinder.client.UiField; -import com.google.gwt.user.client.ui.CheckBox; import com.google.gwt.user.client.ui.ListBox; import com.google.gwt.user.client.ui.VerticalPanel; -import static com.google.appinventor.client.Ode.MESSAGES; - /** * An implementation of SimpleVisibleComponentsPanel for the MockForm designer. * @@ -58,7 +52,7 @@ public void onChange(ChangeEvent event) { int idx = Integer.parseInt(listboxPhoneTablet.getSelectedValue()); int width = drop_lst[idx][0]; int height = drop_lst[idx][1]; - String val = Integer.toString(idx) + "," + Integer.toString(width) + "," + Integer.toString(height); + String val = idx + "," + width + "," + height; // here, we can change settings by putting val into it projectEditor.changeProjectSettingsProperty(SettingsConstants.PROJECT_YOUNG_ANDROID_SETTINGS, SettingsConstants.YOUNG_ANDROID_SETTINGS_PHONE_TABLET, val); @@ -178,10 +172,6 @@ protected void changeFormPreviewSize(int idx, int width, int height) { if (root == null) { return; } - - if (root == null) - return; - root.changePreviewSize(width, height, idx); } @@ -194,13 +184,11 @@ protected void changeFormPhonePreview(int idx, String chosenVal) { } public void enableTabletPreviewCheckBox(boolean enable){ - if (root != null){ + if (root != null) { if (!enable){ changeFormPreviewSize(0, 320, 505); - listboxPhoneTablet.setVisible(enable); } else { getUserSettingChangeSize(); - listboxPhoneTablet.setVisible(enable); } } listboxPhoneTablet.setEnabled(enable); @@ -210,13 +198,10 @@ public void enablePhonePreviewCheckBox(boolean enable){ if (root != null) { if (!enable) { changeFormPhonePreview(-1, "Classic"); - listboxPhonePreview.setVisible(enable); } else { getUserSettingChangePreview(); - listboxPhonePreview.setVisible(enable); } } listboxPhonePreview.setEnabled(enable); } - } diff --git a/appinventor/appengine/src/com/google/appinventor/client/style/neo/UiFactoryNeo.java b/appinventor/appengine/src/com/google/appinventor/client/style/neo/UiFactoryNeo.java index 139cd30bea..2719a3809b 100644 --- a/appinventor/appengine/src/com/google/appinventor/client/style/neo/UiFactoryNeo.java +++ b/appinventor/appengine/src/com/google/appinventor/client/style/neo/UiFactoryNeo.java @@ -7,9 +7,6 @@ import com.google.appinventor.client.UiStyleFactory; import com.google.appinventor.client.editor.ProjectEditor; -import com.google.appinventor.client.editor.simple.SimpleNonVisibleComponentsPanel; -import com.google.appinventor.client.editor.simple.SimpleVisibleComponentsPanel; -import com.google.appinventor.client.editor.youngandroid.YaFormEditor; import com.google.appinventor.client.editor.youngandroid.YaNonVisibleComponentsPanel; import com.google.appinventor.client.editor.youngandroid.YaVisibleComponentsPanel; import com.google.appinventor.client.explorer.folder.ProjectFolder; diff --git a/appinventor/appengine/src/com/google/appinventor/client/style/neo/YaVisibleComponentsPanelNeo.java b/appinventor/appengine/src/com/google/appinventor/client/style/neo/YaVisibleComponentsPanelNeo.java index 7f5c9b3a71..4744165734 100644 --- a/appinventor/appengine/src/com/google/appinventor/client/style/neo/YaVisibleComponentsPanelNeo.java +++ b/appinventor/appengine/src/com/google/appinventor/client/style/neo/YaVisibleComponentsPanelNeo.java @@ -7,9 +7,6 @@ import com.google.appinventor.client.components.Icon; import com.google.appinventor.client.editor.ProjectEditor; -import com.google.appinventor.client.editor.simple.SimpleEditor; -import com.google.appinventor.client.editor.simple.SimpleNonVisibleComponentsPanel; -import com.google.appinventor.client.editor.simple.components.MockForm; import com.google.appinventor.client.editor.youngandroid.YaNonVisibleComponentsPanel; import com.google.appinventor.client.editor.youngandroid.YaVisibleComponentsPanel; import com.google.appinventor.shared.settings.SettingsConstants; @@ -92,6 +89,5 @@ protected void bindUI() { uibinder.createAndBindUi(this); super.listboxPhonePreview = listboxPhonePreview; super.listboxPhoneTablet = listboxPhoneTablet; - super.phoneScreen = phoneScreen; } }