[view] reorganize packages
This commit is contained in:
@@ -3,7 +3,8 @@ package haxework.view;
|
||||
import flash.display.DisplayObject;
|
||||
import flash.geom.Rectangle;
|
||||
import haxework.view.core.Geometry;
|
||||
import haxework.view.skin.ISkin.SkinSet;
|
||||
import haxework.view.group.IGroupView;
|
||||
import haxework.view.skin.ISkin;
|
||||
|
||||
interface IView<C:DisplayObject> {
|
||||
public var id(default, default):String;
|
||||
|
||||
@@ -1,29 +0,0 @@
|
||||
package haxework.view;
|
||||
|
||||
class ProgressView extends SpriteView {
|
||||
|
||||
public var value(default, set):Int;
|
||||
public var max(default, set):Int;
|
||||
|
||||
public function new() {
|
||||
super();
|
||||
value = 0;
|
||||
max = 1;
|
||||
}
|
||||
|
||||
private function set_value(value:Int):Int {
|
||||
if (this.value != value) {
|
||||
this.value = value;
|
||||
invalidate();
|
||||
}
|
||||
return this.value;
|
||||
}
|
||||
|
||||
private function set_max(value:Int):Int {
|
||||
if (max != value) {
|
||||
max = value;
|
||||
invalidate();
|
||||
}
|
||||
return max;
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,5 @@
|
||||
package haxework.view;
|
||||
|
||||
import haxework.provider.Provider;
|
||||
import flash.display.DisplayObject;
|
||||
import flash.display.StageAlign;
|
||||
import flash.display.StageScaleMode;
|
||||
@@ -8,7 +7,9 @@ import flash.errors.Error;
|
||||
import flash.events.Event;
|
||||
import flash.geom.Rectangle;
|
||||
import flash.Lib;
|
||||
import haxework.provider.Provider;
|
||||
import haxework.signal.Signal;
|
||||
import haxework.view.group.IGroupView;
|
||||
|
||||
class Root {
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import flash.display.Sprite;
|
||||
import flash.events.MouseEvent;
|
||||
import haxework.signal.Signal;
|
||||
import haxework.view.core.Geometry.Position;
|
||||
import haxework.view.group.HGroupView;
|
||||
import haxework.view.list.ScrollBarView;
|
||||
import haxework.view.list.VScrollBarView;
|
||||
import haxework.view.skin.Skin;
|
||||
|
||||
@@ -4,6 +4,7 @@ import flash.display.DisplayObject;
|
||||
import flash.display.InteractiveObject;
|
||||
import flash.geom.Rectangle;
|
||||
import haxework.view.core.Geometry;
|
||||
import haxework.view.group.IGroupView;
|
||||
import haxework.view.skin.ISkin;
|
||||
import haxework.view.theme.ITheme;
|
||||
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package haxework.view;
|
||||
package haxework.view.data;
|
||||
|
||||
using haxework.utils.StringUtil;
|
||||
import haxework.view.DataView.Factory;
|
||||
import haxework.view.form.ToggleButtonView;
|
||||
import haxework.view.data.DataView.Factory;
|
||||
import haxe.EnumTools;
|
||||
import haxework.view.layout.HorizontalLayout;
|
||||
import haxework.view.layout.ILayout;
|
||||
|
||||
using haxework.utils.StringUtil;
|
||||
|
||||
class ButtonGroup<D> extends DataView<D, ToggleButtonView> {
|
||||
|
||||
public var selected(default, set):D;
|
||||
@@ -1,8 +1,9 @@
|
||||
package haxework.view;
|
||||
package haxework.view.data;
|
||||
|
||||
import flash.display.DisplayObject;
|
||||
import flash.events.MouseEvent;
|
||||
import haxework.signal.Signal;
|
||||
import haxework.view.group.GroupView;
|
||||
import haxework.view.layout.ILayout;
|
||||
import haxework.view.layout.VerticalLayout;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package haxework.view;
|
||||
package haxework.view.form;
|
||||
|
||||
import flash.display.BitmapData;
|
||||
import haxework.view.skin.ButtonBitmapSkin;
|
||||
@@ -1,4 +1,4 @@
|
||||
package haxework.view;
|
||||
package haxework.view.form;
|
||||
|
||||
import haxework.signal.Signal;
|
||||
import flash.events.MouseEvent;
|
||||
@@ -1,4 +1,4 @@
|
||||
package haxework.view;
|
||||
package haxework.view.form;
|
||||
|
||||
import flash.events.Event;
|
||||
import flash.events.KeyboardEvent;
|
||||
@@ -1,7 +1,8 @@
|
||||
package haxework.view;
|
||||
package haxework.view.form;
|
||||
|
||||
import haxework.view.core.VAlign;
|
||||
import haxework.view.core.HAlign;
|
||||
import haxework.view.core.VAlign;
|
||||
import haxework.view.text.TextView;
|
||||
|
||||
class LabelView extends TextView {
|
||||
|
||||
@@ -1,10 +1,13 @@
|
||||
package haxework.view;
|
||||
package haxework.view.form;
|
||||
|
||||
import haxework.view.core.HAlign;
|
||||
import flash.events.MouseEvent;
|
||||
import flash.geom.Point;
|
||||
import haxework.signal.Signal;
|
||||
import haxework.view.core.Geometry.Position;
|
||||
import haxework.view.core.HAlign;
|
||||
import haxework.view.data.DataView;
|
||||
import haxework.view.group.GroupView;
|
||||
import haxework.view.group.IGroupView;
|
||||
import haxework.view.layout.VerticalLayout;
|
||||
import haxework.view.skin.Skin;
|
||||
using haxework.utils.StringUtil;
|
||||
@@ -1,4 +1,4 @@
|
||||
package haxework.view;
|
||||
package haxework.view.form;
|
||||
|
||||
class ToggleButtonView extends ButtonView {
|
||||
|
||||
@@ -2,7 +2,7 @@ package haxework.view.frame;
|
||||
|
||||
import haxework.animate.IAnimate;
|
||||
import haxework.signal.Signal;
|
||||
import haxework.view.GroupView;
|
||||
import haxework.view.group.GroupView;
|
||||
import haxework.view.IView;
|
||||
|
||||
class FrameSwitcher extends GroupView {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package haxework.view.frame;
|
||||
|
||||
import haxework.view.group.GroupView;
|
||||
import haxework.view.layout.ILayout;
|
||||
import haxework.view.layout.VerticalLayout;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package haxework.view;
|
||||
package haxework.view.group;
|
||||
|
||||
import flash.display.DisplayObjectContainer;
|
||||
import haxework.view.layout.DefaultLayout;
|
||||
@@ -1,4 +1,4 @@
|
||||
package haxework.view;
|
||||
package haxework.view.group;
|
||||
|
||||
import haxework.view.layout.HorizontalLayout;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package haxework.view;
|
||||
package haxework.view.group;
|
||||
|
||||
import flash.display.DisplayObjectContainer;
|
||||
import haxework.view.layout.ILayout;
|
||||
@@ -1,4 +1,4 @@
|
||||
package haxework.view;
|
||||
package haxework.view.group;
|
||||
|
||||
import haxework.view.layout.VerticalLayout;
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
package haxework.view.layout;
|
||||
|
||||
import haxework.view.core.Geometry;
|
||||
import haxework.view.core.VAlign;
|
||||
import haxework.view.core.HAlign;
|
||||
import haxework.view.core.VAlign;
|
||||
import haxework.view.group.IGroupView;
|
||||
|
||||
class DefaultLayout extends Layout {
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package haxework.view.layout;
|
||||
|
||||
import haxework.view.core.Geometry.SizeValue;
|
||||
import haxework.view.core.HAlign;
|
||||
import haxework.view.group.IGroupView;
|
||||
|
||||
class HorizontalLayout extends DefaultLayout {
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package haxework.view.layout;
|
||||
|
||||
import haxework.view.group.IGroupView;
|
||||
import haxework.view.core.VAlign;
|
||||
import haxework.view.core.HAlign;
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package haxework.view.layout;
|
||||
|
||||
import haxework.view.core.VAlign;
|
||||
import haxework.view.core.HAlign;
|
||||
import haxework.view.core.VAlign;
|
||||
import haxework.view.group.IGroupView;
|
||||
|
||||
class Layout implements ILayout {
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package haxework.view.layout;
|
||||
|
||||
import haxework.view.core.VAlign;
|
||||
import haxework.view.group.IGroupView;
|
||||
|
||||
typedef Row = {
|
||||
var width:Float;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
package haxework.view.layout;
|
||||
|
||||
import haxework.view.core.VAlign;
|
||||
import haxework.view.core.Geometry.SizeValue;
|
||||
import haxework.view.core.VAlign;
|
||||
import haxework.view.group.IGroupView;
|
||||
|
||||
class VerticalLayout extends DefaultLayout {
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package haxework.view.list;
|
||||
|
||||
import haxework.view.core.HAlign;
|
||||
import haxework.view.form.LabelView;
|
||||
import haxework.view.list.ListView.IListItemView;
|
||||
|
||||
private typedef Formatter<T> = Int -> T -> String;
|
||||
|
||||
@@ -1,13 +1,15 @@
|
||||
package haxework.view.list;
|
||||
|
||||
import flash.events.MouseEvent;
|
||||
import haxework.signal.Signal;
|
||||
import haxework.utils.NumberUtil;
|
||||
import haxework.view.core.Geometry.Position;
|
||||
import haxework.view.core.HAlign;
|
||||
import haxework.view.core.VAlign;
|
||||
import haxework.view.form.ButtonView;
|
||||
import haxework.view.group.GroupView;
|
||||
import haxework.view.layout.ILayout;
|
||||
import haxework.view.skin.Skin;
|
||||
import haxework.signal.Signal;
|
||||
import haxework.utils.NumberUtil;
|
||||
|
||||
class ListView<D> extends GroupView {
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package haxework.view.popup;
|
||||
|
||||
import haxework.view.group.IGroupView;
|
||||
import haxework.animate.IAnimate;
|
||||
import haxework.view.IGroupView;
|
||||
|
||||
typedef P = PopupView<Dynamic>;
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package haxework.view.popup;
|
||||
import flash.display.DisplayObject;
|
||||
import flash.events.MouseEvent;
|
||||
import haxework.view.core.Geometry.Position;
|
||||
import haxework.view.GroupView;
|
||||
import haxework.view.group.GroupView;
|
||||
import haxework.view.skin.Skin;
|
||||
import promhx.Deferred;
|
||||
import promhx.Promise;
|
||||
|
||||
@@ -2,7 +2,8 @@ package haxework.view.skin;
|
||||
|
||||
import flash.display.BitmapData;
|
||||
import flash.geom.Rectangle;
|
||||
import haxework.view.ButtonView.ButtonState;
|
||||
import haxework.view.form.ButtonView.ButtonState;
|
||||
import haxework.view.form.ButtonView;
|
||||
import haxework.view.utils.BitmapUtil;
|
||||
import haxework.view.utils.DrawUtil;
|
||||
|
||||
|
||||
@@ -5,7 +5,8 @@ import flash.display.Graphics;
|
||||
import flash.display.JointStyle;
|
||||
import flash.display.LineScaleMode;
|
||||
import haxework.color.ColorUtil;
|
||||
import haxework.view.ButtonView;
|
||||
import haxework.view.form.ButtonView;
|
||||
import haxework.view.form.ToggleButtonView;
|
||||
|
||||
class ButtonColorSkin implements ISkin<ButtonView> {
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@ package haxework.view.skin;
|
||||
|
||||
import haxework.view.core.HAlign;
|
||||
import haxework.view.core.VAlign;
|
||||
import haxework.view.group.IGroupView;
|
||||
import haxework.view.layout.ILayout;
|
||||
|
||||
class LayoutSkin implements ISkin<IGroupView> {
|
||||
|
||||
@@ -1,9 +1,11 @@
|
||||
package haxework.view.skin;
|
||||
|
||||
import haxework.view.utils.DrawUtil.FillType;
|
||||
import haxework.view.layout.ILayout;
|
||||
import haxework.view.core.Geometry;
|
||||
import flash.display.BitmapData;
|
||||
import haxework.view.core.Geometry;
|
||||
import haxework.view.form.ButtonView;
|
||||
import haxework.view.layout.ILayout;
|
||||
import haxework.view.text.ITextView;
|
||||
import haxework.view.utils.DrawUtil;
|
||||
|
||||
class Skin {
|
||||
|
||||
|
||||
@@ -2,6 +2,8 @@ package haxework.view.skin;
|
||||
|
||||
import flash.display.Graphics;
|
||||
import haxework.color.ColorUtil;
|
||||
import haxework.view.form.ButtonView;
|
||||
import haxework.view.form.ToggleButtonView;
|
||||
|
||||
class TabColorSkin extends ButtonColorSkin {
|
||||
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package haxework.view.skin;
|
||||
|
||||
import haxework.view.text.ITextView;
|
||||
|
||||
class TextSkin implements ISkin<ITextView> {
|
||||
|
||||
public var fontColor(default, default):Int;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package haxework.view;
|
||||
package haxework.view.text;
|
||||
|
||||
import flash.text.TextField;
|
||||
import haxework.view.IView;
|
||||
@@ -1,4 +1,4 @@
|
||||
package haxework.view;
|
||||
package haxework.view.text;
|
||||
|
||||
import haxework.view.layout.ILayout;
|
||||
import haxework.view.layout.Layout;
|
||||
@@ -1,5 +1,6 @@
|
||||
package haxework.view.theme;
|
||||
|
||||
import haxework.view.text.ITextView;
|
||||
import haxework.color.Color;
|
||||
import haxework.view.skin.ISkin;
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
package haxework.view.theme;
|
||||
|
||||
import flash.text.FontType;
|
||||
import flash.text.Font;
|
||||
import flash.text.FontType;
|
||||
import haxework.color.Color;
|
||||
import haxework.view.skin.ISkin;
|
||||
import haxework.view.skin.Skin;
|
||||
import haxework.view.text.ITextView;
|
||||
import haxework.view.theme.ITheme;
|
||||
|
||||
using haxework.color.ColorUtil;
|
||||
|
||||
Reference in New Issue
Block a user