Make nscreenModelManger.
Change-Id: I83a5eb5d8f5664cff67f2a0a96f69776a0176dd6
Signed-off-by: yonghwan82.jeon <yonghwan82.jeon@samsung.com>
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.Iterator;
-import java.util.LinkedList;
import java.util.List;
import java.util.Map;
import org.tizen.webuibuilder.model.css.io.CssReader;
import org.tizen.webuibuilder.model.descriptors.DescriptorManager;
import org.tizen.webuibuilder.model.filedata.AppFileData;
-import org.tizen.webuibuilder.model.nscreen.Device;
-import org.tizen.webuibuilder.model.nscreen.NScreenModel;
-import org.tizen.webuibuilder.model.nscreen.NScreenModel.NScreenType;
-import org.tizen.webuibuilder.model.nscreen.NScreenModel.Orientation;
+import org.tizen.webuibuilder.model.nscreen.NScreenModelManger;
+import org.tizen.webuibuilder.model.nscreen.descriptors.NScreenDescriptor;
import org.tizen.webuibuilder.model.page.IPageDataSetListener;
import org.tizen.webuibuilder.model.page.PageData;
import org.tizen.webuibuilder.model.page.PageDataSet;
private PartFactory partFactory = null;
private AppFileData appFileData = new AppFileData();
- private List<NScreenModel> nscreenModels = new ArrayList<NScreenModel>();
-
private List<IAppListener> listeners = new ArrayList<IAppListener>();
private List<IAppListener> removeListeners = new ArrayList<IAppListener>();
private boolean processEventFlag = false;
private String rootFullPath;
+ private NScreenModelManger nscreenModelManger;
+ private NScreenDescriptor nscreenDescriptor;
+
/**
* Constructor.
*
this.projectManager = projectManager;
this.descriptorManager = descriptorManager;
partFactory = new PartFactory(descriptorManager);
- this.initializeNscreenModel();
+ nscreenModelManger = new NScreenModelManger();
+ nscreenDescriptor = new NScreenDescriptor(this);
pageDataSet = new PageDataSet();
pageDataSet.addPageListener(this);
return null;
}
- protected void initializeNscreenModel() {
- IFile file = this.projectManager.getProject().getFile("index.meta.xml");
- if (file.exists()) {
- // read metafile.
- return;
- }
-
- createCommonNscreen();
- createOrientationNscreen();
- createPixelRatioNscreen();
- createDeviceNscreen();
- }
-
- public NScreenModel createCommonNscreen() {
- return addNscreenModel(BuilderConstants.NSCREENCOMMON, NScreenType.COMMON, null, 0, 0, 0,
- BuilderConstants.NSCREENCOMMON.toLowerCase());
- }
-
- public void createOrientationNscreen() {
- addNscreenModel(BuilderConstants.NSCREENPORTRAIT, NScreenType.ORIENTATION,
- Orientation.PORTRAIT, 0, 0, 0,
- BuilderConstants.NSCREENPORTRAIT.toLowerCase());
- addNscreenModel(BuilderConstants.NSCREENLANDSCAPE, NScreenType.ORIENTATION,
- Orientation.LANDSCAPE, 0, 0, 0,
- BuilderConstants.NSCREENLANDSCAPE.toLowerCase());
- }
-
- public void createPixelRatioNscreen() {
- addNscreenModel("Pixcel Ratio 1.0", NScreenType.PIXELRATIO, null, 1.0, 0, 0, "pixcel_ratio_1_0");
- addNscreenModel("Pixcel Ratio 1.5", NScreenType.PIXELRATIO, null, 1.5, 0, 0, "pixcel_ratio_1_5");
- addNscreenModel("Pixcel Ratio 2.0", NScreenType.PIXELRATIO, null, 2.0, 0, 0, "pixcel_ratio_2_0");
- addNscreenModel("Pixcel Ratio 3.0", NScreenType.PIXELRATIO, null, 3.0, 0, 0, "pixcel_ratio_3_0");
- }
-
- public void createDeviceNscreen() {
- addNscreenModel("Wearable 320x320 (1:1)(P)", NScreenType.RESOLUTION, null, 0, 320, 320,
- "wearable_320x320");
- addNscreenModel("Wearable 360x480 (3:4)(P)", NScreenType.RESOLUTION, null, 0, 360, 480,
- "wearable_360x480");
- addNscreenModel("Wearable 480x360 (4:3)(L)", NScreenType.RESOLUTION, null, 0, 480, 360,
- "wearable_480x360");
- addNscreenModel("Wearable 312x496 (10:16)(P)", NScreenType.RESOLUTION, null, 0, 312, 496,
- "wearable_312x496");
- addNscreenModel("Wearable 496x312 (16:10)(L)", NScreenType.RESOLUTION, null, 0, 496, 312,
- "wearable_496x312");
- addNscreenModel("Mobile 320x480 (2:3)(P)", NScreenType.RESOLUTION, null, 0, 320, 480,
- "mobile_320x480");
- addNscreenModel("Mobile 480x320 (3:2)(L)", NScreenType.RESOLUTION, null, 0, 480, 320,
- "mobile_480x320");
- addNscreenModel("Mobile 360x640 (9:16)(P)", NScreenType.RESOLUTION, null, 0, 360, 640,
- "mobile_360x640");
- addNscreenModel("Mobile 640x360 (16:9)(L)", NScreenType.RESOLUTION, null, 0, 640, 360,
- "mobile_640x360");
- addNscreenModel("Mobile 800x1280 (10:16)(P)", NScreenType.RESOLUTION, null, 0, 800, 1280,
- "mobile_800x1280");
- addNscreenModel("Mobile 1280x800 (16:10)(L)", NScreenType.RESOLUTION, null, 0, 1280, 800,
- "mobile_1280x800");
- addNscreenModel("TV 1920x1080 (16:9)(P)", NScreenType.RESOLUTION, null, 0, 1920, 1080,
- "tv_1920x1080");
- addNscreenModel("TV 1080x1920 (9:16)(L)", NScreenType.RESOLUTION, null, 0, 1080, 1920,
- "tv_1080x1920");
- }
-
- private NScreenModel addNscreenModel(String name, NScreenType type, Orientation orientation,
- double devicePixelRatio, int deviceWidth,
- int deviceHeight, String fileName) {
- if (name == null) {
- return null;
- }
-
- if (name.isEmpty()) {
- return null;
- }
-
- if (type == null) {
- return null;
- }
- NScreenModel model = new NScreenModel(name, type);
-
- if (orientation != null) {
- model.setOrientation(orientation);
- }
-
- if (devicePixelRatio != 0) {
- model.setDevicePixelRatio(devicePixelRatio);
- }
-
- if (deviceWidth != 0) {
- model.setDeviceWidth(deviceWidth);
- }
-
- if (deviceHeight != 0) {
- model.setDeviceHeight(deviceHeight);
- }
-
- if (fileName != null) {
- if (!fileName.isEmpty()) {
- model.setFileName(fileName);
- }
- }
- this.addNScreenModel(model);
-
- return model;
- }
-
- public boolean addNScreenModel(NScreenModel model) {
- if (isValidNscreenModel(model)) {
- this.nscreenModels.add(model);
- return true;
- }
- return false;
- }
-
- public void removeNScreenModel(NScreenModel model) {
- this.nscreenModels.remove(model);
- }
-
- public List<NScreenModel> getNScreenModels() {
- return this.nscreenModels;
- }
-
- public NScreenModel getNScreenModel(String nscreenName) {
- NScreenModel model = null;
-
- if (nscreenName == null) {
- return null;
- }
-
- if (nscreenName.isEmpty()) {
- return null;
- }
-
- if (nscreenModels.size() == 0) {
- return null;
- }
-
- for (int i = 0; i < nscreenModels.size(); i++) {
- if (nscreenName.equalsIgnoreCase(this.nscreenModels.get(i).getName())) {
- model = this.nscreenModels.get(i);
- break;
- }
- }
-
- return model;
- }
-
- public NScreenModel getCommonNscreen() {
- if (nscreenModels.size() == 0) {
- return createCommonNscreen();
- }
- return this.getNScreenModel(BuilderConstants.NSCREENCOMMON);
- }
-
- public boolean isValidNscreenModel(NScreenModel model) {
- if (getNScreenModel(model.getName()) == null) {
- return true;
- }
- return false;
+ public NScreenModelManger getNScreenModelManger() {
+ return this.nscreenModelManger;
}
- private NScreenModel getNScreenModel(NScreenType type, Object object) {
- NScreenModel model = null;
- NScreenModel retValue = null;
-
- if (type == null) {
- return null;
- }
-
- if (object == null) {
- return null;
- }
-
- // Common
- if (type == NScreenType.COMMON) {
- return this.getCommonNscreen();
- }
-
- // Orientation
- if (type == NScreenType.ORIENTATION) {
- if (!(object instanceof String)) {
- return null;
- }
-
- String orientation = (String) object;
-
- if (NScreenModel.Orientation.PORTRAIT.toString().equalsIgnoreCase(orientation)) {
- return getNScreenModel(BuilderConstants.NSCREENPORTRAIT);
- } else {
- return getNScreenModel(BuilderConstants.NSCREENLANDSCAPE);
- }
-
- }
-
- if (type == NScreenType.PIXELRATIO) {
- if (!(object instanceof Double)) {
- return null;
- }
- double pixelRatio = (double) object;
-
- for (int i = 0; i < this.nscreenModels.size(); i++) {
- model = this.nscreenModels.get(i);
- if (model.getType() == type) {
- if (model.getDevicePixelRatio() == pixelRatio) {
- retValue = model;
- break;
- }
- }
- }
- }
-
- return retValue;
- }
-
- public List<NScreenModel> getNScreenModelsForDevice(Device device) {
- List<NScreenModel> list = new LinkedList<NScreenModel>();
-
- // add Common Model.
- list.add(this.getCommonNscreen());
-
- // add Orientation
- if (device.getOrientation() != null) {
- list.add(getNScreenModel(NScreenType.ORIENTATION, device.getOrientation().toString()));
- }
-
- // add pixel ratio
- if (device.getDevicePixelRatio() > 0) {
- list.add(getNScreenModel(NScreenType.PIXELRATIO, device.getDevicePixelRatio()));
- }
-
- // add Resolution
- if ((device.getDeviceWidth() > 0) && (device.getDeviceHeight() > 0)) {
- for (int i = 0; i < this.nscreenModels.size(); i++) {
- NScreenModel model = this.nscreenModels.get(i);
- if (model.getDeviceWidth() == device.getDeviceWidth()) {
- if (model.getDeviceHeight() == device.getDeviceHeight()) {
- list.add(model);
- }
- }
- }
- }
-
- return list;
+ public NScreenDescriptor getNScreenDescriptor() {
+ return this.nscreenDescriptor;
}
}
String projectFolder = projectManager.getProject().getLocation().toString();
for (NScreenModel model : nscreenModel) {
- addNScreenModel( model );
+ getNScreenModelManger().addNScreenModel(model);
// for ( String page : model.getEnalbePages() ) {
// String cssFileFullPath = projectFolder + IPath.SEPARATOR + page + "." +model.getFileName();
//
// }
public static Element writeNScreen(Document doc, Element nscreenElement, AppManager appManager) {
- List<NScreenModel> list = appManager.getNScreenModels();
+ List<NScreenModel> list = appManager.getNScreenModelManger().getNScreenModels();
// Collections.sort(list, new Comparator<NScreenModel>() {
// @Override
// public int compare(NScreenModel o1, NScreenModel o2) {
public NScreenModelController(AppManager appManager) {
logger.info("Create Class");
this.appManager = appManager;
- this.modelList = this.appManager.getNScreenModels();
+ this.modelList = this.appManager.getNScreenModelManger().getNScreenModels();
this.addListener();
}
--- /dev/null
+/*
+ * UI Builder
+ *
+ * Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+
+package org.tizen.webuibuilder.model.nscreen;
+
+import java.util.ArrayList;
+import java.util.LinkedList;
+import java.util.List;
+
+import org.tizen.webuibuilder.BuilderConstants;
+import org.tizen.webuibuilder.model.nscreen.NScreenModel.NScreenType;
+
+
+public class NScreenModelManger {
+ private List<NScreenModel> nscreenModels = new ArrayList<NScreenModel>();
+
+ public NScreenModelManger() {
+ }
+
+ public NScreenModel createCommonNscreen() {
+ NScreenModel model = new NScreenModel(BuilderConstants.NSCREENCOMMON, NScreenType.COMMON);
+ model.setFileName(BuilderConstants.NSCREENCOMMON.toLowerCase());
+ model.setDefaultInMenu(true);
+ model.setEnableInMenu(false);
+ model.setLinkInMenu(false);
+ model.setMoveInMenu(false);
+ this.addNScreenModel(model);
+ return model;
+ }
+
+ public boolean addNScreenModel(NScreenModel model) {
+ if (isValidNscreenModel(model)) {
+ this.nscreenModels.add(model);
+ return true;
+ }
+ return false;
+ }
+
+ public void removeNScreenModel(NScreenModel model) {
+ this.nscreenModels.remove(model);
+ }
+
+ public List<NScreenModel> getNScreenModels() {
+ return this.nscreenModels;
+ }
+
+ public NScreenModel getNScreenModel(String nscreenName) {
+ NScreenModel model = null;
+
+ if (nscreenName == null) {
+ return null;
+ }
+
+ if (nscreenName.isEmpty()) {
+ return null;
+ }
+
+ if (nscreenModels.size() == 0) {
+ return null;
+ }
+
+ for (int i = 0; i < nscreenModels.size(); i++) {
+ if (nscreenName.equalsIgnoreCase(this.nscreenModels.get(i).getName())) {
+ model = this.nscreenModels.get(i);
+ break;
+ }
+ }
+
+ return model;
+ }
+
+ public NScreenModel getCommonNscreen() {
+ if (nscreenModels.size() == 0) {
+ return createCommonNscreen();
+ }
+ return this.getNScreenModel(BuilderConstants.NSCREENCOMMON);
+ }
+
+ public boolean isValidNscreenModel(NScreenModel model) {
+ if (getNScreenModel(model.getName()) == null) {
+ return true;
+ }
+ return false;
+ }
+
+ private NScreenModel getNScreenModel(NScreenType type, Object object) {
+ NScreenModel model = null;
+ NScreenModel retValue = null;
+
+ if (type == null) {
+ return null;
+ }
+
+ if (object == null) {
+ return null;
+ }
+
+ // Common
+ if (type == NScreenType.COMMON) {
+ return this.getCommonNscreen();
+ }
+
+ // Orientation
+ if (type == NScreenType.ORIENTATION) {
+ if (!(object instanceof String)) {
+ return null;
+ }
+
+ String orientation = (String) object;
+
+ if (NScreenModel.Orientation.PORTRAIT.toString().equalsIgnoreCase(orientation)) {
+ return getNScreenModel(BuilderConstants.NSCREENPORTRAIT);
+ } else {
+ return getNScreenModel(BuilderConstants.NSCREENLANDSCAPE);
+ }
+
+ }
+
+ if (type == NScreenType.PIXELRATIO) {
+ if (!(object instanceof Double)) {
+ return null;
+ }
+ double pixelRatio = (Double) object;
+
+ for (int i = 0; i < this.nscreenModels.size(); i++) {
+ model = this.nscreenModels.get(i);
+ if (model.getType() == type) {
+ if (model.getDevicePixelRatio() == pixelRatio) {
+ retValue = model;
+ break;
+ }
+ }
+ }
+ }
+
+ return retValue;
+ }
+
+ public List<NScreenModel> getNScreenModelsForDevice(Device device) {
+ List<NScreenModel> list = new LinkedList<NScreenModel>();
+
+ // add Common Model.
+ list.add(this.getCommonNscreen());
+
+ // add Orientation
+ if (device.getOrientation() != null) {
+ list.add(getNScreenModel(NScreenType.ORIENTATION, device.getOrientation().toString()));
+ }
+
+ // add pixel ratio
+ if (device.getDevicePixelRatio() > 0) {
+ list.add(getNScreenModel(NScreenType.PIXELRATIO, device.getDevicePixelRatio()));
+ }
+
+ // add Resolution
+ if ((device.getDeviceWidth() > 0) && (device.getDeviceHeight() > 0)) {
+ for (int i = 0; i < this.nscreenModels.size(); i++) {
+ NScreenModel model = this.nscreenModels.get(i);
+ if (model.getDeviceWidth() == device.getDeviceWidth()) {
+ if (model.getDeviceHeight() == device.getDeviceHeight()) {
+ list.add(model);
+ }
+ }
+ }
+ }
+
+ return list;
+ }
+}
--- /dev/null
+/*
+ * UI Builder
+ *
+ * Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd. All rights reserved.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * Contributors:
+ * - S-Core Co., Ltd
+ *
+ */
+
+
+package org.tizen.webuibuilder.model.nscreen.descriptors;
+
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.tizen.webuibuilder.BuilderConstants;
+import org.tizen.webuibuilder.model.app.AppManager;
+import org.tizen.webuibuilder.model.nscreen.NScreenModel;
+import org.tizen.webuibuilder.model.nscreen.NScreenModel.NScreenType;
+import org.tizen.webuibuilder.model.nscreen.NScreenModel.Orientation;
+
+
+public class NScreenDescriptor {
+ private AppManager appManger = null;
+ private List<NScreenModel> list = null;
+
+ public NScreenDescriptor(AppManager appManger) {
+ this.appManger = appManger;
+ this.list = this.appManger.getNScreenModelManger().getNScreenModels();
+ load();
+ }
+
+ private void load() {
+ IFile file = appManger.getProjectManager().getProject().getFile("index.meta.xml");
+ if (file.exists()) {
+ // read metafile.
+ return;
+ }
+
+ createCommonNscreen();
+ createOrientationNscreen();
+ createPixelRatioNscreen();
+ createDeviceNscreen();
+ }
+
+ public void createCommonNscreen() {
+ addNscreenModel(BuilderConstants.NSCREENCOMMON, NScreenType.COMMON, null, 0, 0, 0,
+ BuilderConstants.NSCREENCOMMON.toLowerCase());
+ }
+
+ public void createOrientationNscreen() {
+ addNscreenModel(BuilderConstants.NSCREENPORTRAIT, NScreenType.ORIENTATION,
+ Orientation.PORTRAIT, 0, 0, 0,
+ BuilderConstants.NSCREENPORTRAIT.toLowerCase());
+ addNscreenModel(BuilderConstants.NSCREENLANDSCAPE, NScreenType.ORIENTATION,
+ Orientation.LANDSCAPE, 0, 0, 0,
+ BuilderConstants.NSCREENLANDSCAPE.toLowerCase());
+ }
+
+ public void createPixelRatioNscreen() {
+ addNscreenModel("Pixcel Ratio 1.0", NScreenType.PIXELRATIO, null, 1.0, 0, 0,
+ "pixcel_ratio_1_0");
+ addNscreenModel("Pixcel Ratio 1.5", NScreenType.PIXELRATIO, null, 1.5, 0, 0,
+ "pixcel_ratio_1_5");
+ addNscreenModel("Pixcel Ratio 2.0", NScreenType.PIXELRATIO, null, 2.0, 0, 0,
+ "pixcel_ratio_2_0");
+ addNscreenModel("Pixcel Ratio 3.0", NScreenType.PIXELRATIO, null, 3.0, 0, 0,
+ "pixcel_ratio_3_0");
+ }
+
+ public void createDeviceNscreen() {
+ addNscreenModel("Wearable 320x320 (1:1)", NScreenType.RESOLUTION, null, 0, 320, 320,
+ "wearable_320x320");
+ addNscreenModel("Wearable 360x480 (3:4)", NScreenType.RESOLUTION, null, 0, 360, 480,
+ "wearable_360x480");
+ addNscreenModel("Wearable 480x360 (4:3)", NScreenType.RESOLUTION, null, 0, 480, 360,
+ "wearable_480x360");
+ addNscreenModel("Wearable 312x496 (10:16)", NScreenType.RESOLUTION, null, 0, 312, 496,
+ "wearable_312x496");
+ addNscreenModel("Wearable 496x312 (16:10)", NScreenType.RESOLUTION, null, 0, 496, 312,
+ "wearable_496x312");
+ addNscreenModel("Mobile 320x480 (2:3)", NScreenType.RESOLUTION, null, 0, 320, 480,
+ "mobile_320x480");
+ addNscreenModel("Mobile 480x320 (3:2)", NScreenType.RESOLUTION, null, 0, 480, 320,
+ "mobile_480x320");
+ addNscreenModel("Mobile 360x640 (9:16)", NScreenType.RESOLUTION, null, 0, 360, 640,
+ "mobile_360x640");
+ addNscreenModel("Mobile 640x360 (16:9)", NScreenType.RESOLUTION, null, 0, 640, 360,
+ "mobile_640x360");
+ addNscreenModel("Mobile 800x1280 (10:16)", NScreenType.RESOLUTION, null, 0, 800, 1280,
+ "mobile_800x1280");
+ addNscreenModel("Mobile 1280x800 (16:10)", NScreenType.RESOLUTION, null, 0, 1280, 800,
+ "mobile_1280x800");
+ addNscreenModel("TV 1920x1080 (16:9)", NScreenType.RESOLUTION, null, 0, 1920, 1080,
+ "tv_1920x1080");
+ addNscreenModel("TV 1080x1920 (9:16)", NScreenType.RESOLUTION, null, 0, 1080, 1920,
+ "tv_1080x1920");
+ }
+
+ public void addNscreenModel(String name, NScreenType type, Orientation orientation,
+ double devicePixelRatio, int deviceWidth, int deviceHeight,
+ String fileName) {
+ if (name == null) {
+ return;
+ }
+
+ if (name.isEmpty()) {
+ return;
+ }
+
+ if (type == null) {
+ return;
+ }
+ NScreenModel model = new NScreenModel(name, type);
+
+ if (orientation != null) {
+ model.setOrientation(orientation);
+ }
+
+ if (devicePixelRatio != 0) {
+ model.setDevicePixelRatio(devicePixelRatio);
+ }
+
+ if (deviceWidth != 0) {
+ model.setDeviceWidth(deviceWidth);
+ }
+
+ if (deviceHeight != 0) {
+ model.setDeviceHeight(deviceHeight);
+ }
+
+ if (fileName != null) {
+ if (!fileName.isEmpty()) {
+ model.setFileName(fileName);
+ }
+ }
+ this.setMenuFlag(model);
+ this.list.add(model);
+ }
+
+ public void setMenuFlag(NScreenModel model) {
+ if (model == null) {
+ return;
+ }
+
+ if (model.getType() == NScreenType.COMMON) {
+ model.setDefaultInMenu(true);
+ model.setEnableInMenu(false);
+ model.setLinkInMenu(false);
+ model.setMoveInMenu(false);
+ }
+
+ if (model.getType() == NScreenType.ORIENTATION) {
+ model.setDefaultInMenu(false);
+ model.setEnableInMenu(true);
+ model.setLinkInMenu(false);
+ model.setMoveInMenu(false);
+ }
+
+ if (model.getType() == NScreenType.PIXELRATIO) {
+ model.setDefaultInMenu(false);
+ model.setEnableInMenu(true);
+ model.setLinkInMenu(true);
+ model.setMoveInMenu(false);
+ }
+
+ if (model.getType() == NScreenType.RESOLUTION) {
+ model.setDefaultInMenu(false);
+ model.setEnableInMenu(true);
+ model.setLinkInMenu(true);
+ model.setMoveInMenu(true);
+ }
+
+ if (model.getType() == NScreenType.CUSTOM) {
+ // noting.
+ }
+ }
+
+}
+++ /dev/null
-/*
- * UI Builder
- *
- * Copyright (c) 2000 - 2014 Samsung Electronics Co., Ltd. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * Contributors:
- * - S-Core Co., Ltd
- *
- */
-
-package org.tizen.webuibuilder.model.nscreen.descriptors;
-
-public class NscreenDescriptor {
-
- public NscreenDescriptor() {
- }
-
-}
// }
}
- appManager.addNScreenModel( model );
+ appManager.getNScreenModelManger().addNScreenModel( model );
}
setCssFileToModel(pageData.getCurrentCssFile());
new PageFileData(pageData.getName(), pageData.getVersion(), pageData.getRootPart(),
null);
- for ( NScreenModel model : appManager.getNScreenModels() ) {
+ for ( NScreenModel model : appManager.getNScreenModelManger().getNScreenModels() ) {
pageFileData.getNscreenModelList().add( model );
}
}
CssFile cssFile = loadCssFile(cssPath);
- appManager.getCommonNscreen().setFileName(cssFileName);
+ appManager.getNScreenModelManger().getCommonNscreen().setFileName(cssFileName);
pageData.addCssFile(cssFile);
IEditorPart ieditor = window.getActivePage().getActiveEditor();
PageDesigner editor = (PageDesigner) ieditor;
- List<NScreenModel> list = editor.getAppManager().getNScreenModelsForDevice(device);
+ List<NScreenModel> list =
+ editor.getAppManager().getNScreenModelManger()
+ .getNScreenModelsForDevice(device);
String printData = "";
for (int i = 0; i < list.size(); i++) {
NScreenModel model = list.get(i);
}
public boolean existNscreen(int width) {
- List<NScreenModel> list = mNScreenPageModel.getAppManager().getNScreenModels();
+ List<NScreenModel> list =
+ mNScreenPageModel.getAppManager().getNScreenModelManger().getNScreenModels();
for (NScreenModel model : list) {
if (model.getWidth() == width) {
return true;
model.setFileName(cssFileName);
Command command =
- new NScreenAddCommand(mNScreenPageModel.getAppManager().getNScreenModels(), model,
+ new NScreenAddCommand(mNScreenPageModel.getAppManager().getNScreenModelManger().getNScreenModels(), model,
mNScreenList);
mNScreenPageModel.getPageDesigner().getCommandStack().execute(command);
}
}
public void deleteNScreen(NScreenListItem item) {
- List<NScreenModel> list = mNScreenPageModel.getAppManager().getNScreenModels();
+ List<NScreenModel> list = mNScreenPageModel.getAppManager().getNScreenModelManger().getNScreenModels();
if (list.get(0) == item.getModel()) {
showInfomationDialog("can not delete the default screen.");
return;
mNScreenList = new NScreenList(parent, mNScreenPageModel);
- List<NScreenModel> list = mNScreenPageModel.getAppManager().getNScreenModels();
+ List<NScreenModel> list = mNScreenPageModel.getAppManager().getNScreenModelManger().getNScreenModels();
for (int i = 0, size = list.size(); i < size; i++) {
NScreenModel nsModel = list.get(i);