Menu

[r204]: / SQLAnyware2 / sqlanyware-client / sqlanyware-client-module / src / SQLAnywareClientModule.mxml  Maximize  Restore  History

Download this file

112 lines (87 with data), 3.3 kB

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
<?xml version="1.0" encoding="utf-8"?>
<mx:Module
xmlns:mx="http://www.adobe.com/2006/mxml"
layout="vertical"
width="100%" height="100%"
styleName="application"
verticalAlign="middle"
horizontalAlign="center"
xmlns:business="org.sqlanyware.sqlwclient.business.*"
xmlns:control="org.sqlanyware.sqlwclient.control.*"
xmlns:view="org.sqlanyware.sqlwclient.view.*"
xmlns:login="org.sqlanyware.sqlwclient.view.login.*"
initialize="onInitialize()"
xmlns:controls="org.sqlanyware.sqlwclient.controls.*">
<mx:Style source="/assets/stylesheet.css"/>
<mx:Script>
<![CDATA[
import org.sqlanyware.utils.DeferredInstanceFromFunctionWithoutCache;
import org.sqlanyware.sqlwclient.view.Workspace;
import org.sqlanyware.sqlwclient.controls.AddChildEx;
import mx.collections.ArrayCollection;
import org.sqlanyware.sqlwclient.model.ApplicationModelLocator;
private var zzz : ArrayCollection = new ArrayCollection();
[Bindable]
private var model : ApplicationModelLocator = null;
private function onInitialize() : void {
this.model = ApplicationModelLocator.getInstance();
}
private function getState( logonInfo : Object ) : String {
var result : String = "";
if ( null == logonInfo ) {
result = "stateNotLogged";
}
else {
result = "stateLogged";
}
return result;
}
private function onReset( event : Event ) : void {
this.dispatchEvent( new Event("done") );
}
private function createWorkspace() : Object {
var workspace : Workspace = new Workspace();
workspace.setStyle("showEffect", fadeIn );
workspace.setStyle("hideEffect", fadeOut );
workspace = new Workspace();
workspace.percentHeight = 100;
workspace.percentWidth = 100;
return workspace;
}
[Bindable]
private var workspaceFactory : IDeferredInstance =
new DeferredInstanceFromFunctionWithoutCache( createWorkspace );
]]>
</mx:Script>
<business:Services/>
<control:ApplicationController/>
<mx:Binding source="getState( model.logonInfo )" destination="currentState"/>
<mx:states>
<mx:State name="stateLogged">
<controls:AddChildEx
targetFactory="{workspaceFactory}"
/>
</mx:State>
<mx:State name="stateNotLogged">
<mx:AddChild>
<login:LoginPanel id="loginPanel"/>
</mx:AddChild>
</mx:State>
</mx:states>
<!-- Define Transition array with one Transition object.-->
<mx:Fade id="fadeOut" alphaFrom="1" alphaTo="0" duration="500"/>
<mx:Fade id="fadeIn" alphaFrom="0" alphaTo="1" duration="500"/>
<mx:transitions>
<!-- A transition for changing from any state to any state. -->
<mx:Transition fromState="stateNotLogged" toState="stateLogged">
<mx:Parallel>
<mx:Fade alphaFrom="1" alphaTo="0" duration="500" target="{loginPanel}"/>
</mx:Parallel>
</mx:Transition>
<mx:Transition fromState="stateLogged" toState="stateNotLogged">
<mx:Parallel>
<mx:Fade alphaFrom="0" alphaTo="1" duration="500" target="{loginPanel}"/>
</mx:Parallel>
</mx:Transition>
</mx:transitions>
</mx:Module>
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.