}
Point convertedDragWindowOffset = SwingUtilities.convertPoint(w,
dragWindowOffset, SubstanceRootPaneUI.this.getTitlePane());
Frame f = null;
Dialog d = null;
if (w instanceof Frame) {
f = (Frame) w;
} else if (w instanceof Dialog) {
d = (Dialog) w;
}
int frameState = (f != null) ? f.getExtendedState() : 0;
if ((SubstanceRootPaneUI.this.getTitlePane() != null)
&& SubstanceRootPaneUI.this.getTitlePane().contains(
convertedDragWindowOffset)) {
if ((((f != null) && ((frameState & Frame.MAXIMIZED_BOTH) == 0)) || (d != null))
&& (dragWindowOffset.y >= SubstanceRootPaneUI.BORDER_DRAG_THICKNESS)
&& (dragWindowOffset.x >= SubstanceRootPaneUI.BORDER_DRAG_THICKNESS)
&& (dragWindowOffset.x < w.getWidth()
- SubstanceRootPaneUI.BORDER_DRAG_THICKNESS)) {
this.isMovingWindow = true;
this.dragOffsetX = dragWindowOffset.x;
this.dragOffsetY = dragWindowOffset.y;
}
} else if (((f != null) && f.isResizable() && ((frameState & Frame.MAXIMIZED_BOTH) == 0))
|| ((d != null) && d.isResizable())) {
this.dragOffsetX = dragWindowOffset.x;
this.dragOffsetY = dragWindowOffset.y;
this.dragWidth = w.getWidth();
this.dragHeight = w.getHeight();
this.dragCursor = this.getCursor(this.calculateCorner(w,