package org.tizen.webuibuilder.model;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import java.util.HashMap;
import java.util.Iterator;
public Rectangle getPositionProperty() {
if (getPositionMode() == PositionMode.ABSOLUTE_POSITION) {
// return position;
- Part page = getOwnerPage();
- String selectorName = EMPTY;
- if (page == null) {
- selectorName = SHARP + getIdPropertyValue();
- } else {
- selectorName =
- SHARP + page.getIdPropertyValue() + SPACE + SHARP + getIdPropertyValue();
- }
+// String selectorName = getDefaultSelectorName();
// String left = getSelectorPropertyValue(selectorName, LEFT);
// String top = getSelectorPropertyValue(selectorName, TOP);
return rect;
} else if (getPositionMode() == PositionMode.RELATIVE_POSITION) {
// return position;
- Part page = getOwnerPage();
- String selectorName = EMPTY;
- if (page == null) {
- selectorName = SHARP + getIdPropertyValue();
- } else {
- selectorName =
- SHARP + page.getIdPropertyValue() + SPACE + SHARP + getIdPropertyValue();
- }
+ String selectorName = getDefaultSelectorName();
String left = getSelectorPropertyValue(selectorName, LEFT);
String top = getSelectorPropertyValue(selectorName, TOP);
lockRefresh();
//Point newPosition = ScreenToPage(new Point(position.x, position.y));
Point newPosition = new Point(position.x, position.y);
- Part page = getOwnerPage();
- String selectorName = EMPTY;
- if (page == null) {
- selectorName = SHARP + getIdPropertyValue();
- } else {
- selectorName =
- SHARP + page.getIdPropertyValue() + SPACE + SHARP + getIdPropertyValue();
- }
+ String selectorName = getDefaultSelectorName();
// String parentName = TypeDescriptor.ID_OF_GROUP_POSITION;
setSelectorPropertyValue(selectorName, LEFT, String.valueOf(newPosition.x) + PX, null);
// this.position.setBounds(position);
// }
unlockRefresh();
- fireEvent(new CssEvent(EventType.CSS_NEED_REFRESH, this, selectorName, null, null));
+
+ List<String> keyList = Arrays.asList(LEFT, TOP, WIDTH, HEIGHT);
+ fireEvent(new CssEvent(EventType.CSS_NEED_REFRESH, this, selectorName, keyList));
fireEvent(new CssEvent(EventType.CSS_POSITION_CHANGED, this, selectorName, EMPTY, EMPTY));
} else if (getPositionMode() == PositionMode.RELATIVE_POSITION) {
lockRefresh();
// Point newPosition = ScreenToPage(new Point(position.x, position.y));
- Part page = getOwnerPage();
- String selectorName = EMPTY;
- if (page == null) {
- selectorName = SHARP + getIdPropertyValue();
- } else {
- selectorName =
- SHARP + page.getIdPropertyValue() + SPACE + SHARP + getIdPropertyValue();
- }
+ String selectorName = getDefaultSelectorName();
// String parentName = TypeDescriptor.ID_OF_GROUP_POSITION;
// setSelectorPropertyValue(selectorName, LEFT, String.valueOf(newPosition.x) + PX,
// this.position.setBounds(position);
// }
unlockRefresh();
- fireEvent(new CssEvent(EventType.CSS_NEED_REFRESH, this, selectorName, null, null));
+
+ List<String> keyList = Arrays.asList(WIDTH, HEIGHT);
+ fireEvent(new CssEvent(EventType.CSS_NEED_REFRESH, this, selectorName, keyList));
fireEvent(new CssEvent(EventType.CSS_POSITION_CHANGED, this, selectorName, EMPTY, EMPTY));
}
// this.position.setBounds(position);
// }
unlockRefresh();
- fireEvent(new CssEvent(EventType.CSS_NEED_REFRESH, this, selectorName, null, null));
+
+ List<String> keyList = Arrays.asList(LEFT, TOP);
+
+ fireEvent(new CssEvent(EventType.CSS_NEED_REFRESH, this, selectorName, keyList));
fireEvent(new CssEvent(EventType.CSS_POSITION_CHANGED, this, selectorName, EMPTY, EMPTY));
} else if (getPositionMode() == PositionMode.RELATIVE_POSITION) {
lockRefresh();
// Point newPosition = ScreenToPage(new Point(position.x, position.y));
- Part page = getOwnerPage();
- String selectorName = EMPTY;
- if (page == null) {
- selectorName = SHARP + getIdPropertyValue();
- } else {
- selectorName =
- SHARP + page.getIdPropertyValue() + SPACE + SHARP + getIdPropertyValue();
- }
+ String selectorName = getDefaultSelectorName();
// String parentName = TypeDescriptor.ID_OF_GROUP_POSITION;
// setSelectorPropertyValue(selectorName, LEFT, String.valueOf(newPosition.x) + PX,
// this.position.setBounds(position);
// }
unlockRefresh();
- fireEvent(new CssEvent(EventType.CSS_NEED_REFRESH, this, selectorName, null, null));
+ fireEvent(new CssEvent(EventType.CSS_NEED_REFRESH, this, selectorName, null));
fireEvent(new CssEvent(EventType.CSS_POSITION_CHANGED, this, selectorName, EMPTY, EMPTY));
}
Rectangle newPosition = new Rectangle();
if (getPositionMode() == PositionMode.ABSOLUTE_POSITION) {
- Part page = getOwnerPage();
- String selectorName = EMPTY;
- if (page == null) {
- selectorName = SHARP + getIdPropertyValue();
- } else {
- selectorName =
- SHARP + page.getIdPropertyValue() + SPACE + SHARP + getIdPropertyValue();
- }
-
+ String selectorName = getDefaultSelectorName();
String left = getSelectorPropertyValue(selectorName, LEFT);
String top = getSelectorPropertyValue(selectorName, TOP);
String width = getSelectorPropertyValue(selectorName, WIDTH);
// }
lockRefresh();
- Part page = getOwnerPage();
- String selectorName = EMPTY;
- if (page == null) {
- selectorName = SHARP + getIdPropertyValue();
- } else {
- selectorName = SHARP + page.getIdPropertyValue() + SPACE + SHARP + getIdPropertyValue();
- }
+ String selectorName = getDefaultSelectorName();
// String parentName = TypeDescriptor.ID_OF_GROUP_POSITION;
setSelectorPropertyValue(selectorName, WIDTH, String.valueOf(size.x) + PX, null);
setSelectorPropertyValue(selectorName, HEIGHT, String.valueOf(size.y) + PX, null);
unlockRefresh();
- fireEvent(new CssEvent(EventType.CSS_NEED_REFRESH, this, selectorName, null, null));
+
+ List<String> keyList = Arrays.asList(WIDTH, HEIGHT);
+ fireEvent(new CssEvent(EventType.CSS_NEED_REFRESH, this, selectorName, keyList));
fireEvent(new CssEvent(EventType.CSS_POSITION_CHANGED, this, selectorName, EMPTY, EMPTY));
fireEvent(new PartEvent(PartEvent.EventType.POSITION_CHANGED, this, EMPTY, EMPTY));