OSDN Git Service

Refactor to make model rendering reusable
authorTor Norbye <tnorbye@google.com>
Thu, 11 Nov 2010 01:05:01 +0000 (17:05 -0800)
committerTor Norbye <tnorbye@google.com>
Thu, 11 Nov 2010 01:19:56 +0000 (17:19 -0800)
commit5cdaad56ce59f9efc92cd8c3c1faf6c58b686a0f
tree951203113fcac696260cf038e197fcf02c1cbaa0
parent4db3692678ec4b2367c36bc2abeaa5f58776345a
Refactor to make model rendering reusable

This changeset refactors the code in GraphicalEditorPart a bit to make
the part which renders a model into an image reusable. This will be
used by an upcoming changeset to provide previews of palette items as
you drag them.

The refactoring is straightforward, even though the diffs
unfortunately don't show it. I basically split up the large
recomputeLayout() method into smaller separate chunks (validating the
current file, validating the model and validating the sdk and looking
up the bridge) and added a new render method which can take just a
model (separate from the editor's own model) and render it.

Change-Id: I96603c4beb2d56d36416cd2b6448c87dd306217c
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/IGraphicalLayoutEditor.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/GraphicalEditorPart.java
eclipse/plugins/com.android.ide.eclipse.adt/src/com/android/ide/eclipse/adt/internal/editors/layout/gle2/PaletteComposite.java