private ResolutionManger resolution;
private ScreenSize currentScreen;
private ScaleData scaleData;
- private Device defaultDevice = null;
+ private Device defaultMobileDevice = null;
+ private Device defaultWearableDevice = null;
private boolean isLandscape;
private boolean isFiting;
isLandscape = false;
isFiting = false;
- nscreen = new NScreenHistory();
- nscreen.setModelName(BuilderConstants.NSCREENCOMMON);
+
widgetEvent();
AnimatorUtils.getWorkbenchWindow().getSelectionService().addSelectionListener(this);
// ProjectManager.getProjectManager(project);
// PageData pageData = mainEditor.getPageData();
// pageData.addPageListener(this);
- defaultDevice = new Device("DefaultDevice", "Default Device [360x640, 9:16, PR:2.0]");
- defaultDevice.setOrientation(Orientation.PORTRAIT);
- defaultDevice.setDevicePixelRatio(2.0);
- defaultDevice.setDeviceWidth(360);
- defaultDevice.setDeviceHeight(640);
- defaultDevice.setWidth(720);
- defaultDevice.setHeight(1280);
+ defaultMobileDevice = new Device("Default", "Default [360x640]");
+ defaultMobileDevice.setOrientation(Orientation.PORTRAIT);
+ defaultMobileDevice.setDevicePixelRatio(2.0);
+ defaultMobileDevice.setDeviceWidth(360);
+ defaultMobileDevice.setDeviceHeight(640);
+ defaultMobileDevice.setWidth(720);
+ defaultMobileDevice.setHeight(1280);
+
+ defaultWearableDevice = new Device("Default", "Default [320x320]");
+ defaultWearableDevice.setOrientation(Orientation.PORTRAIT);
+ defaultWearableDevice.setDevicePixelRatio(2.0);
+ defaultWearableDevice.setDeviceWidth(320);
+ defaultWearableDevice.setDeviceHeight(320);
+ defaultWearableDevice.setWidth(720);
+ defaultWearableDevice.setHeight(1280);
}
public void dispose() {
// }
if (!resolution.getDeviceMode().equals(appManager.getFrameworkScale())) {
- setResolution(DeviceManager.getDeviceManager().getDevices(), null);
+ setResolution(DeviceManager.getDeviceManager().getDevices());
resetMenuPart();
}
}
+ public void setResolution(List<Device> devices) {
+ Device device = null;
+ NScreenUtil.nscreen_log(mainEditor.getAppManager().getFrameworkScale());
+ resolution
+ .setScreeSizesFromNScreen(devices, mainEditor.getAppManager().getFrameworkScale());
+ screenSize.setEnabled(resolution.getEnable());
+
+ String profile = appManager.getPlatform();
+ if (profile.contains("mobile")) {
+ device = devices.get(1);
+
+ } else if (profile.contains("wearable")) {
+ device = devices.get(0);
+ }
+ currentScreen =
+ new ScreenSize(device.getDeviceWidth(), device.getDeviceHeight(),
+ device.getDisplayName());
+ nscreen = new NScreenHistory();
+ nscreen.setLastResolution(device.getDisplayName());
+ nscreen.setScale(1f);
+
+ screenSizeText.setText(currentScreen.getScreenSize());
+ }
+
public void setResolution(List<Device> devices, NScreenItem nsItem) {
if (nsItem != null) {
nscreen = nsItem.getNScreenHistory();
Device device = null;
if (devices.isEmpty()) {
- devices.add(defaultDevice);
+ String profile = appManager.getPlatform();
+ if (profile.contains("mobile")) {
+ devices.add(defaultMobileDevice);
+ } else if (profile.contains("wearable")) {
+ devices.add(defaultWearableDevice);
+ }
}
NScreenUtil.nscreen_log(mainEditor.getAppManager().getFrameworkScale());
resolution
private void resetMenuPart() {
// isLandscape = false;
// isFiting = true;
- currentScreen = resolution.getScreenSize(0);
+ if (currentScreen == null) {
+ currentScreen = resolution.getScreenSize(0);
+ }
screenSizeText.setText(currentScreen.getScreenSize());
scaleValueText.setText("100");
}
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.ControlEvent;
import org.eclipse.swt.events.ControlListener;
-import org.eclipse.swt.events.PaintEvent;
-import org.eclipse.swt.events.PaintListener;
-import org.eclipse.swt.graphics.Color;
-import org.eclipse.swt.graphics.Font;
-import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
-import org.eclipse.swt.layout.FormAttachment;
-import org.eclipse.swt.layout.FormData;
-import org.eclipse.swt.layout.FormLayout;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.ui.part.Page;
-import org.tizen.webuibuilder.animator.ui.views.timeline.common.ColorResource;
-import org.tizen.webuibuilder.model.css.CssFile;
+import org.tizen.webuibuilder.model.nscreen.Device;
+import org.tizen.webuibuilder.model.nscreen.DeviceManager;
import org.tizen.webuibuilder.model.nscreen.NScreenModel;
import org.tizen.webuibuilder.ui.views.nscreen.model.NScreenPageModel;
for (NScreenModel model : models) {
if (groups.size() == 0) {
+ // first group and first item = common
group =
- // mParentComposite.createNewGroup(model.getType(), mNScreenPageModel
- // .getPageData().getName());
mParentComposite
.createNewGroup(model.getType(), model.getType().toString());
- // group.setHeight(40);
- group.addItem(model);
+ NScreenItem commonItem = group.addItem(model);
+ NScreenHistory commonHistory = new NScreenHistory();
+
+ List<Device> devices = DeviceManager.getDeviceManager().getDevices();
+ Device device = null;
+ String profile = mNScreenPageModel.getAppManager().getPlatform();
+ if (profile.contains("mobile")) {
+ device = devices.get(1);
+ } else if (profile.contains("wearable")) {
+ device = devices.get(0);
+ }
+ commonHistory.setModelName(model.getName());
+ commonHistory.setLastResolution(device.getDisplayName());
+ commonHistory.setScale(1f);
+ commonItem.setNScreenHistory(commonHistory);
} else {
NScreenGroup selectedGroup = null;
for (NScreenGroup g : groups) {