hc_diff20141130a.diff
src/com/goldencode/p2j/ui/chui/ThinClient.java | ||
---|---|---|
2039 | 2039 |
import com.goldencode.p2j.ui.client.chui.driver.*; |
2040 | 2040 |
import com.goldencode.p2j.ui.client.driver.*; |
2041 | 2041 |
import com.goldencode.p2j.ui.client.event.*; |
2042 |
import com.goldencode.p2j.ui.client.gui.driver.GuiDriver; |
|
2042 | 2043 |
import com.goldencode.p2j.ui.client.widget.*; |
2043 | 2044 |
import com.goldencode.p2j.util.*; |
2044 | 2045 |
import com.goldencode.util.*; |
... | ... | |
15385 | 15386 |
} |
15386 | 15387 | |
15387 | 15388 |
/** |
15389 |
* Returns display size. |
|
15390 |
* |
|
15391 |
* For multiple-display environments the display is selected based on the supplied window id. |
|
15392 |
* |
|
15393 |
* @param windowId |
|
15394 |
* A valid window id. |
|
15395 |
* |
|
15396 |
* @return The dimensions in pixels. |
|
15397 |
*/ |
|
15398 |
@Override |
|
15399 |
public NativeDimension getDisplaySize(int windowId) |
|
15400 |
{ |
|
15401 |
ScreenDriver<?> driver = tk.getInstanceDriver(); |
|
15402 |
if (driver instanceof GuiDriver) |
|
15403 |
{ |
|
15404 |
return ((GuiDriver) driver).getDisplaySize(windowId); |
|
15405 |
} |
|
15406 |
else |
|
15407 |
{ |
|
15408 |
Dimension dim = tk.screenDimension(windowId); |
|
15409 |
return new NativeDimension((int) dim.width, (int) dim.height); |
|
15410 |
} |
|
15411 |
} |
|
15412 |
|
|
15413 |
/** |
|
15414 |
* Returns an application-usable display area. For example, a task bar is |
|
15415 |
* not counted as the usable area. |
|
15416 |
* |
|
15417 |
* For multiple-display environments the display is selected based on the supplied window id. |
|
15418 |
* |
|
15419 |
* @param windowId |
|
15420 |
* A valid window id. |
|
15421 |
* |
|
15422 |
* @return The area in pixels. |
|
15423 |
*/ |
|
15424 |
@Override |
|
15425 |
public NativeRectangle getDisplayWorkArea(int windowId) |
|
15426 |
{ |
|
15427 |
ScreenDriver<?> driver = tk.getInstanceDriver(); |
|
15428 |
if (driver instanceof GuiDriver) |
|
15429 |
{ |
|
15430 |
return ((GuiDriver) driver).getDisplayWorkArea(windowId); |
|
15431 |
} |
|
15432 |
else |
|
15433 |
{ |
|
15434 |
Dimension dim = tk.screenDimension(windowId); |
|
15435 |
return new NativeRectangle(0, 0, (int) dim.height, (int) dim.width); |
|
15436 |
} |
|
15437 |
} |
|
15438 | ||
15439 |
/** |
|
15388 | 15440 |
* Widget/frame hiding processor |
15389 | 15441 |
* |
15390 | 15442 |
* @author SIY |
... | ... | |
15654 | 15706 |
this.input = input; |
15655 | 15707 |
} |
15656 | 15708 |
} |
15657 | ||
15658 | 15709 |
} |
src/com/goldencode/p2j/ui/client/AlertBox.java | ||
---|---|---|
146 | 146 |
/** Flag indicating the title must be forced to left-align. */ |
147 | 147 |
protected boolean forceTitleLeftAlign = false; |
148 | 148 | |
149 |
/** Config instance. */ |
|
150 |
private WindowConfig config; |
|
151 | ||
149 | 152 |
/** |
150 | 153 |
* Creates a modal dialog with a title and with a frame owner. This |
151 | 154 |
* constructor creates an AlertBox with a message body which is |
... | ... | |
187 | 190 |
Color color) |
188 | 191 |
{ |
189 | 192 |
super(title, new Insets(0, 0, 0, 0)); |
193 |
|
|
194 |
// create (empty) config to assign id to the instance |
|
195 |
WidgetId id = WidgetId.nextID(); |
|
196 |
WindowConfig config = new WindowConfig(); |
|
197 |
config.id = id; |
|
198 |
this.config = config; |
|
190 | 199 | |
191 | 200 |
if (color != null) |
192 | 201 |
this.alertColor = color; |
... | ... | |
794 | 803 |
// this is a special case: if the alert box is hidden, then its no longer available. |
795 | 804 |
WindowManager.remove(this); |
796 | 805 |
} |
806 | ||
807 |
/** |
|
808 |
* Provide access to the attributes stored in the widget. |
|
809 |
* |
|
810 |
* @return Reference to attribute container. |
|
811 |
*/ |
|
812 |
@SuppressWarnings("unchecked") |
|
813 |
@Override |
|
814 |
public WindowConfig config() |
|
815 |
{ |
|
816 |
return config; |
|
817 |
} |
|
797 | 818 |
} |
src/com/goldencode/p2j/ui/client/widgetbrowser/WidgetBrowserAspect.java | ||
---|---|---|
128 | 128 |
*/ |
129 | 129 |
private synchronized void handleHighlightWidget(Widget<?> widget) |
130 | 130 |
{ |
131 |
Window<?> window = (Window<?>) widget.ancestor(); |
|
132 |
if (window == null) |
|
131 |
if (widget.ancestor() == null || !(widget.ancestor() instanceof Window<?>)) |
|
133 | 132 |
{ |
134 | 133 |
return; |
135 | 134 |
} |
136 | 135 |
|
136 |
Window<?> window = (Window<?>) widget.ancestor(); |
|
137 |
|
|
137 | 138 |
WidgetBrowser browser = activeBrowsers.get(window); |
138 | 139 |
if (browser == null || !browser.isHighlighted(widget)) |
139 | 140 |
{ |