diff options
author | Tor Norbye <tnorbye@google.com> | 2011-07-07 12:07:02 -0700 |
---|---|---|
committer | Tor Norbye <tnorbye@google.com> | 2011-07-11 15:50:45 -0700 |
commit | 4eacdfbcc84ad11f599020b12ad76aebed70537f (patch) | |
tree | 636c232685a3196cdb2667b1d3c075eb8ab9026c /eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GCWrapper.java | |
parent | e7929da09356242f4440a35acff412f9ed7fc1d1 (diff) | |
download | sdk-4eacdfbcc84ad11f599020b12ad76aebed70537f.tar.gz |
Grid Layout Support.
This changeset adds basic support for grid layouts:
- Freeform mode where you can drag & drop anywhere in the layout, and
guidelines are offered to align with other left boundaries, right
boundaries, baseline vertical alignment and center layout horizontal
alingment. In addition, it also offers "preferred spacing"
positioning, using the recommended distance between widgets.
Also, during a drag a regular 16x16 grid is also (faintly) shown and
(when there are no alignment matches as explained above) the
position snaps to this grid.
We also show the grid-structure (rows and columns, not the regular
snapping grid) during drags to make it more obvious that behind the
scenes there is a grid (because some other operations might shift
rows and columns so it's important to present the right user model.)
The freeform grid layout editor will automatically create rows and
columns and size them using spacers which are hidden from the user,
and on deletion these are automatically cleaned up as well.
- Grid mode where you can drag to any given cell, or between any two
rows or columns.
- Some layout actions for manipulating the grid (add/remove row and
column, adjust the gravity, toggle modes.)
This CL also contains various diagnostics code for the grid mode, and
does not yet correctly support dragging multiple views simultaneously.
Change-Id: Ie9ec54805039645e3db78d19095da86b04e44ca0
Diffstat (limited to 'eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GCWrapper.java')
-rwxr-xr-x | eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GCWrapper.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GCWrapper.java b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GCWrapper.java index cd4105d91..b1366a374 100755 --- a/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GCWrapper.java +++ b/eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GCWrapper.java @@ -488,6 +488,17 @@ public class GCWrapper implements IGraphics { return color; } + // dots + + public void drawPoint(int x, int y) { + checkGC(); + useStrokeAlpha(); + x = mHScale.translate(x); + y = mVScale.translate(y); + + getGc().drawPoint(x, y); + } + // arrows private static final int MIN_LENGTH = 10; |