Openlaszlo scaling issue in resizestate - openlaszlo

I am actually trying to create a highlighter when dragging i was able to achieve this using the resize state and drawview class. But this is not working when the view is scaled.
When i am trying to drag the mouse sometimes its working and sometimes the selected region is either getting diminished or getting enlarged. I have attached the sample code
<canvas width="1024" height="768" debug="true">
<class name="boxdraw">
<handler name="onmousedown"><![CDATA[
Debug.write("onmousedown");
this.boxview.setAttribute ('x', this.getMouse ('x'));
this.boxview.setAttribute ('y', this.getMouse ('y'));
this.boxview.setAttribute ('width', 0);
this.boxview.setAttribute ('height', 0);
this.boxview.setAttribute ('visible', true);
this.boxview.resizer.apply ();
]]></handler>
<handler name="onmouseup"><![CDATA[
Debug.write("onmouseip");
this.boxview.setAttribute ('visible', false);
this.boxview.resizer.remove ();
]]></handler>
<handler name="oninit" >
this.setAttribute ('clickable', true);
</handler>
<drawview name="boxview" visible="false">
<attribute name="isready" value="false" type="boolean" />
<handler name="oncontext">
this.setAttribute("isready", true);
this.strokeStyle = 0x999999;
this.lineWidth = 2;
</handler>
<handler name="oninit">
this.strokeStyle = 0x999999;
this.lineWidth = 2;
</handler>
<resizestate name="resizer">
<attribute name="minheight" value="${-this.y + 1}"/>
<attribute name="minwidth" value="${-this.x + 1}"/>
<attribute name="maxheight" value="${classroot.height - this.y - 1}"/>
<attribute name="maxwidth" value="${classroot.width - this.x - 1}"/>
<attribute name="xroffset" value="${this.x - this.width + this.getMouse( 'x' )}" />
<attribute name="yroffset" value="${this.y - this.height + this.getMouse( 'y' )}" />
<attribute name="width"
value="${(this.immediateparent.getMouse ( 'x' ) - this.xroffset) > this.maxwidth ?
this.maxwidth :
Math.max((this.immediateparent.getMouse( 'x' )- this.xroffset), this.minwidth)}" />
<attribute name="height"
value="${(this.immediateparent.getMouse ( 'y' ) - this.yroffset) > this.maxheight ?
this.maxheight :
Math.max((this.immediateparent.getMouse( 'y' )- this.yroffset), this.minheight)}" />
<handler name="onwidth">
this._draw ();
</handler>
<handler name="onheight">
this._draw ();
</handler>
<method name="_draw"><![CDATA[
Debug.write("__draw", this.minheight, this.maxheight,this.minwidth,this.maxwidth);
Debug.write("this.xroffset,this.yroffset", this.xroffset,this.yroffset);
Debug.write("this.immediateparent.getMouse ( 'x' )",this.immediateparent.getMouse ( 'x' ),this.immediateparent.getMouse ( 'y' ));
this.clear ();
this.beginPath();
this.lineTo (this.width, 0);
this.lineTo (this.width, this.height);
this.lineTo (0, this.height);
this.lineTo (0, 0);
this.closePath();
this.stroke ();
]]></method>
</resizestate>
</drawview>
</class>
<view name="sample" width="1024" height="600" bgcolor="green" xscale="1.63" yscale="1.53">
<boxdraw name="resizebox"
width="100%" height="100%"
options="ignorelayout"
visible="true"/>
</view>
</canvas>

Related

Callback when Ext.NET Combobox local query returns no data

Using Ext.NET combobox.
<ext:ComboBox runat="server"
ID="ComboBoxCategorizedList"
QueryMode="Local"
ValueField="Id"
EmptyText="Type to begin search..."
TypeAhead="false"
DisplayField="Name"
Width="500"
NoteAlign="Down" EnableKeyEvents="true"
Note="Press 'Search' icon or Press ENTER for more results"
RemoveClearTrigger="true">
<%--Note="Type '*' for a full list"--%>
<HtmlBin>
<ext:XScript runat="server">
<script type="text/javascript">
$(window).on("__refresh__", function () {
#{ StoreComboBoxCategorizedList }.reload();
});
</script>
</ext:XScript>
</HtmlBin>
<Store>
<ext:Store runat="server" ID="StoreComboBoxCategorizedList" OnReadData="ComboBoxCategorizedList_ReadData">
<Proxy>
<ext:PageProxy />
</Proxy>
<Model>
<ext:Model Id="ModelCategorizedComboBox" runat="server" IDProperty="Id">
<Fields>
<ext:ModelField Name="Id" />
<ext:ModelField Name="Name" />
<ext:ModelField Name="Type" />
<ext:ModelField Name="RefId" />
<ext:ModelField Name="Description" />
</Fields>
</ext:Model>
</Model>
<Listeners>
<Update Handler="#{ComboBoxCategorizedList}.expand();" />
<EndUpdate Handler="categorizedList();" />
</Listeners>
<Parameters>
<ext:StoreParameter Mode="Raw" Name="filter" Value="#{ComboBoxCategorizedList}.getValue()" />
</Parameters>
</ext:Store>
</Store>
<Triggers>
<ext:FieldTrigger Icon="Clear"/>
<ext:FieldTrigger Icon="Search"></ext:FieldTrigger>
</Triggers>
<Listeners>
<SpecialKey Fn="enterKeyPressHandler" />
<Expand Handler="categorizedList();" Delay="100" />
<BeforeSelect Fn="onBeforeSelect" />
<KeyPress Handler="#{ComboBoxCategorizedList}.getTrigger(1).onClick();" Buffer="1000" />
<Change Handler="filterComboxBoxFunction(#{StoreComboBoxCategorizedList}, #{ComboBoxCategorizedList}.getValue()); #{ComboBoxCategorizedList}.expand(); categorizedList();" Delay="100" />
</Listeners>
Not asking for debugging help, but I want to know if an Ext.NET or Extjs dev has a generic solution: Very simply ... I want to initiate a remote search only when the local search returns no records. So I am looking for the best way to wire this up to the combobox. I've looked at using the Expand event and BeforeQuery event but this seems to come up short.
I'm looking for best practices so i can add a "OnLocalQuery" event to my comboboxes; and then take action if the local query returns 0 matches.
I use this function and it works fine .. and without QueryMode="Local":
<ext:ComboBox ID="cmb_name" runat="server" FieldLabel="ComboBox" EmptyText="-Select-" HideTrigger="true" TriggerAction="All" SelectOnFocus="true" DisplayField="Name" ValueField="Id" Editable="true" TabIndex="11">
<Store>
<ext:Store ID="str_ComboBox" runat="server" PageSize="10">
<Model>
<ext:Model ID="mdl_ComboBox" runat="server">
<Fields>
<ext:ModelField Name="Id" />
<ext:ModelField Name="Name" />
<ext:ModelField Name="Type" />
<ext:ModelField Name="RefId" />
<ext:ModelField Name="Description" />
</Fields>
</ext:Model>
</Model>
</ext:Store>
</Store>
<Listeners>
<Change Fn="fn_filter" />
</Listeners>
</ext:ComboBox>
<script type="text/javascript">
var fn_filter = function (_this, newValue, oldValue, eOpts) {
var n = 0;
if (_this.lastQuery == undefined || _this.lastQuery == null) {
_this.lastQuery = "";
}
_this.getStore().clearFilter(true);
_this.getStore().load();
_this.store.filter(function (item) {
if (item.get('Name').includes(_this.getRawValue())) {
n = n + 1;
return true;
}
else {
return false;
}
});
_this.expand();
if (n == 0) {
//returns no records
//enter code here Callback
}
}
</script>

Maximo Anywhere Tasks for new work order

Not able to create tasks for new work order from Anywhere. Please suggest
Able to create a new work order without task
Added a new view for tasks, and trying to add taskId, status, Asset with lookup and Location with lookup.
lookup are not visible in UI. Here is my code
<view id="WorkExecution.NewAdhocWorkOrderInspTaskView" label="Create Inspection Tasks" >
<requiredResources id="WorkExecution.NewAdhocWorkOrderInspTaskView_requiredResources">
<requiredResource id="WorkExecutionAdhocINspTaskView.NewAdhocWorkOrderView_additionalasset" name="additionalasset"/>
</requiredResources>
<container id="WorkExecution.NewAdhocWorkOrderInspTaskView_workOrder_container_0" resource="AdhocWOInspTaskResource" >
<group id="WorkExecution.NewAdhocWorkOrderInspTaskView_group_0">
<groupitem id="WorkExecution.NewAdhocWorkOrderInspTaskView_workOrder_groupitem_4" >
<text editable="true" id="WorkExecution.NewAdhocWorkOrderView_groupitem_WorkExecution0.Asset" label="Asset2" layoutInsertAt="item1"
lookup="WorkExecutionAdhocWOInsptask" lookupAttribute="assetnum" placeHolder="Tap to enter1" resourceAttribute="InspTaskAssetNum" />
</groupitem>
</group>
</container>
</view>
<resource additionalData="true" id="AdhocWO_InsptaskResource" name="AdhocWOInspTaskResource" describedBy="http://jazz.net/ns/ism/asset/smarter_physical_infrastructure#WoActivity" providedBy="/oslc/sp/SmarterPhysicalInfrastructure" >
<attributes id="AdhocWO_InsptaskResource_attributes">
<attribute describedByProperty="spi:taskid" id="AdhocWO_InsptaskResource_spi_taskid" name="InspTaskId"/>
<attribute describedByProperty="spi:assetnum" id="AdhocWO_InsptaskResource_spi_AssetNum" name="InspTaskAssetNum"/>
<attribute describedByProperty="spi:location" id="AdhocWO_InsptaskResource_spi_Location" name="InspTaskLocation"/>
<attribute describedByProperty="spi:status" id="AdhocWO_InsptaskResource_spi_Status" name="InspTaskStatus"/>
</attributes>
</resource>
<resource additionalData="true" describedBy="http://open-services.net/ns/asset#Asset" id="additionalasset" name="additionalasset" pageSize="1000" providedBy="/oslc/sp/AssetManagement">
<attributes id="additionalasset_attributes">
<attribute describedByProperty="dcterms:identifier" id="additionalasset_assetuid_dctermsidentifier" name="assetuid"/>
<attribute describedByProperty="spi:assetid" id="additionalasset_assetid_spiassetid" name="assetid"/>
<attribute describedByProperty="spi:orgid" id="additionalasset_orgid_spiorgid" index="true" name="orgid"/>
<attribute describedByProperty="spi:siteid" id="additionalasset_siteid_spisiteid" index="true" isExactMatchIndex="true" name="siteid"/>
<attribute describedByProperty="oslc:shortTitle" id="additionalasset_assetnum_oslcshortTitle" index="true" name="assetnum"/>
</attributes>
<queryBases id="additionalasset_queryBases">
<queryBase id="additionalasset_queryBase_getadditionalasset" name="getadditionalasset" queryUri="/oslc/os/oslcasset"/>
</queryBases>
<whereClause id="additionalasset_whereClause"/>
</resource>
<lookup id="WorkExecutionAdhocWOInsptask" label="Select Asset" resource="additionalasset">
<requiredResources id="WorkExecutionAdhocWO_Insptask.AssetLookup_requiredResources">
<requiredResource id="WorkExecutionAdhocWO_Insptask.AssetLookup_additionalasset" name="additionalasset"/>
<requiredResource id="WorkExecutionAdhocWO_Insptask.AssetLookup_workOrder" name="AdhocWOInspTaskResource"/>
</requiredResources>
<list id="WorkExecutionAdhocWO_Insptask.AssetLookup_additionalasset_list" resource="additionalasset">
<listItemTemplate id="WorkExecutionAdhocWO_Insptask.AssetLookup_additionalasset_listItemTemplate_Item2Desc2" layout="Item2Desc2">
<listtext cssClass="bold textappearance-medium" id="WorkExecutionAdhocWO_Insptask.AssetLookup_additionalasset_Item2Desc2_assetnum" layoutInsertAt="item1" resourceAttribute="assetnum"/>
<listtext cssClass="bold textappearance-medium" id="WorkExecutionAdhocWO_Insptask.AssetLookup_additionalasset_Item2Desc2_description" layoutInsertAt="desc1" resourceAttribute="description"/>
<listtext id="WorkExecutionAdhocWO_Insptask.AssetLookup_additionalasset_Item2Desc2_location" layoutInsertAt="item2" resourceAttribute="location"/>
<listtext id="WorkExecutionAdhocWO_Insptask.AssetLookup_additionalasset_Item2Desc2_locationdesc" layoutInsertAt="desc2" resourceAttribute="locationdesc"/>
</listItemTemplate>
</list>
<returnAttributes id="WorkExecutionAdhocWO_Insptask.AssetLookup_returnAttributes">
<returnAttribute id="WorkExecutionAdhocWO_Insptask.AssetLookup_assetnum_asset" sourceAttribute="assetnum" targetAttribute="InspTaskAssetNum" />
</returnAttributes>
</lookup>

Why is this ColdFusion 8 app causing CPU to spike?

Thank you for taking the time to look at this question.... Bear with me....
The other day one of our Web Servers stopped serving up web pages. The Web Server is a physical server running Windows Server 2003 R2 Standard Edition Service Pack 2 with IIS 6. It runs ColdFusion 8.0.1 Standard with Java 1.6.0_24. This server has 3 public-facing websites that really don't get much usage. Pages on all three websites were timing out or returning 500 errors.
When I signed on to the server to see what the problem was, I was expecting to see the JRUN service using a ton of memory. The memory was fine, but, I noticed that the CPU was running at or near 100%. About 50% was being used by JRUN and the other 50% by a runaway backup process, which I killed. But then JRUN quickly ate up the CPU and was using close to 100%.
I looked at the ColdFusion logs and noticed several Java heap space errors occurring.
I looked at the IIS logs and noticed that there were a bunch of requests to an app which allows one of our customers to upload multiple image files for their products using uploadify. The app is written in ColdFusion, and uses jQuery to call a Web Service that handles the upload and resizes the uploaded images using <CFIMAGE>.
After seeing this information in the logs, I figured some part of this app must be the culprit.
I just can't seem to find what exactly caused the Java heap space errors and CPU spike. Any thoughts?
WebService CFC method:
<cffunction
name="uploadFile"
access="remote"
returntype="Struct"
output="false"
returnformat="JSON">
<cfargument name="FileName" type="String" default="" />
<cfargument name="FileData" type="String" default="" />
<cfscript>
var _response = NewAPIResponse();
var _tempFilePath = APPLICATION.TempDir & "\" & ARGUMENTS.FileName;
var _qItem = QueryNew("");
var _product = CreateObject("component", "cfc.Product");
var _result = {};
var _sku = "";
/*
Each file must be named [Part Number].[file extension], so, \
parse the file name to get everything before the file extension
*/
_sku =
Trim(
REQUEST.UDFLib.File.getFileNameWithoutExtension(
ARGUMENTS.FileName
)
);
</cfscript>
<cfif Len(_sku) GT 20>
<cfthrow
message="#ARGUMENTS.FileName#: File Name does not correspond to an existing Part Number." />
</cfif>
<cfset _qItem = _product.readSKU(_sku) />
<cfif NOT _qItem.RECORDCOUNT>
<cfthrow
message="#ARGUMENTS.FileName#: File Name does not correspond to an existing Part Number." />
</cfif>
<cfscript>
FileCopy(ARGUMENTS.FileData, _tempFilePath);
_aMessages =
_product.setId(
_qItem.SKU
).updateThumbnailImages(uploadFilePath = _tempFilePath);
</cfscript>
<cfif ArrayLen(_aMessages)>
<cfthrow
message="#ARGUMENTS.FileName#: #_aMessages[1].getText()#" />
</cfif>
<cfscript>
_result["SKU"] = _product.getSKU();
_result["SMALLIMAGESRC"] = _product.getSmallImageSrc();
_result["LARGEIMAGESRC"] = _product.getLargeImageSrc();
ArrayAppend(_response.data, _result);
</cfscript>
<cfreturn _response />
</cffunction>
Image Resizing Function:
<cffunction name="updateThumbnailImages" returntype="Array" output="false">
<cfargument name="uploadFilePath" type="String" required="true" />
<cfset var _image = {} />
<cfif FileExists(ARGUMENTS.uploadFilePath)>
<cfset _image =
REQUEST.UDFLib.Image.scale(
imagePath = ARGUMENTS.uploadFilePath,
maxHeight = 500,
maxWidth = 700
) />
<cfimage
action="write"
source="#_image#"
overwrite="true"
destination="#getLargeImagePath()#" />
<cfset _image =
REQUEST.UDFLib.Image.scale(
imagePath = ARGUMENTS.uploadFilePath,
maxHeight = 300,
maxWidth = 300
) />
<cfimage
action="write"
source="#_image#"
overwrite="true"
destination="#getMediumImagePath()#" />
<cfset _image =
REQUEST.UDFLib.Image.scale(
imagePath = ARGUMENTS.uploadFilePath,
maxHeight = 50,
maxWidth = 50
) />
<cfimage
action="write"
source="#_image#"
overwrite="true"
destination="#getSmallImagePath()#" />
</cfif>
</cffunction>
Image scaling UDFs:
<cffunction name="getDimensionsToEnlarge" returntype="Struct" output="false">
<cfargument name="imageWidth" type="Numeric" required="true" />
<cfargument name="imageHeight" type="Numeric" required="true" />
<cfargument name="minWidth" type="Numeric" required="true" />
<cfargument name="minHeight" type="Numeric" required="true" />
<cfscript>
var dimensions = {
width = -1,
height = -1
};
if (
ARGUMENTS.minHeight > 0
&& ARGUMENTS.minWidth > 0
&& imageHeight < ARGUMENTS.minHeight
&& imageWidth < ARGUMENTS.minWidth
) {
dimensions.width = ARGUMENTS.minWidth;
dimensions.height = ARGUMENTS.minHeight;
}
return dimensions;
</cfscript>
</cffunction>
<cffunction name="getDimensionsToShrink" returntype="Struct" output="false">
<cfargument name="imageWidth" type="Numeric" required="true" />
<cfargument name="imageHeight" type="Numeric" required="true" />
<cfargument name="maxWidth" type="Numeric" required="true" />
<cfargument name="maxHeight" type="Numeric" required="true" />
<cfscript>
var dimensions = {
width = -1,
height = -1
};
if (
ARGUMENTS.maxHeight > 0
&& ARGUMENTS.maxWidth > 0
&& (
imageHeight > ARGUMENTS.maxHeight
|| imageWidth > ARGUMENTS.maxWidth
)
) {
dimensions.width = ARGUMENTS.maxWidth;
dimensions.height = ARGUMENTS.maxHeight;
}
return dimensions;
</cfscript>
</cffunction>
<cffunction name="getDimensionsToFit" returntype="Struct" output="false">
<cfargument name="imageWidth" type="Numeric" required="true" />
<cfargument name="imageHeight" type="Numeric" required="true" />
<cfargument name="minWidth" type="Numeric" required="true" />
<cfargument name="minHeight" type="Numeric" required="true" />
<cfargument name="maxWidth" type="Numeric" required="true" />
<cfargument name="maxHeight" type="Numeric" required="true" />
<cfscript>
var dimensions = {
width = -1,
height = -1
};
dimensions =
getDimensionsToEnlarge(
imageHeight = ARGUMENTS.imageHeight,
imageWidth = ARGUMENTS.imageWidth,
minWidth = ARGUMENTS.minWidth,
minHeight = ARGUMENTS.minHeight
);
if (dimensions.width < 0 && dimensions.height < 0)
dimensions =
getDimensionsToShrink(
imageHeight = ARGUMENTS.imageHeight,
imageWidth = ARGUMENTS.imageWidth,
maxWidth = ARGUMENTS.maxWidth,
maxHeight = ARGUMENTS.maxHeight
);
return dimensions;
</cfscript>
</cffunction>
<cffunction name="scale" returntype="Any" output="false">
<cfargument name="imagePath" type="String" required="true" />
<cfargument name="action" type="String" default="fit" hint="shrink, enlarge, or fit"/>
<cfargument name="minWidth" type="Numeric" default="-1" />
<cfargument name="minHeight" type="Numeric" default="-1" />
<cfargument name="maxWidth" type="Numeric" default="-1" />
<cfargument name="maxHeight" type="Numeric" default="-1" />
<cfscript>
var scaledDimensions = {
width = -1,
height = -1
};
var scaledImage = ImageNew();
scaledImage = ImageNew(ARGUMENTS.imagePath);
switch (ARGUMENTS.action) {
case "shrink":
scaledDimensions =
getDimensionsToShrink(
imageHeight = scaledImage.getHeight(),
imageWidth = scaledImage.getWidth(),
maxWidth = ARGUMENTS.maxWidth,
maxHeight = ARGUMENTS.maxHeight
);
break;
case "enlarge":
scaledDimensions =
getDimensionsToEnlarge(
imageHeight = scaledImage.getHeight(),
imageWidth = scaledImage.getWidth(),
minWidth = ARGUMENTS.minWidth,
minHeight = ARGUMENTS.minHeight
);
break;
default:
scaledDimensions =
getDimensionsToFit(
imageHeight = scaledImage.getHeight(),
imageWidth = scaledImage.getWidth(),
minWidth = ARGUMENTS.minWidth,
minHeight = ARGUMENTS.minHeight,
maxWidth = ARGUMENTS.maxWidth,
maxHeight = ARGUMENTS.maxHeight
);
break;
}
if (scaledDimensions.width > 0 && scaledDimensions.height > 0) {
// This helps the image quality
ImageSetAntialiasing(scaledImage, "on");
ImageScaleToFit(
scaledImage,
scaledDimensions.width,
scaledDimensions.height
);
}
return scaledImage;
</cfscript>
</cffunction>
Below is the example code I spoke of in the comments section. This improved the reliability for us but under extreme load we found the issue still occured which is why we moved to Java 1.7. However 1.7 had it's own problems as the performance drops dramatically as outlined here. Hope it helps.
<cffunction name="init" access="private" output="false" returntype="void">
<cfset variables.instance = StructNew() />
<!--- create object and set to variables.instance --->
<cfset setProductObject()>
</cffunction>
<cffunction name="setProductObject" access="private" returntype="void" output="false">
<!--- create object once and set it to the variables.instance scope --->
<cfset var product = createObject("component","cfc.Product")>
<cfset variables.instance.product = product/>
<cfset product = javacast('null', '')>
</cffunction>
<cffunction name="getProductObject" access="private" returntype="cfc.Product" output="false">
<!--- instead of creating object each time use the one already in memory and duplicate it --->
<cfset var productObj = duplicate(variables.instance.product)>
<cfreturn productObj />
</cffunction>
<cffunction name="uploadFile" access="remote" returntype="struct" returnformat="JSON" output="false">
<cfargument name="FileName" type="String" default="" />
<cfargument name="FileData" type="String" default="" />
<cfscript>
var _response = NewAPIResponse();
var _tempFilePath = APPLICATION.TempDir & "\" & ARGUMENTS.FileName;
var _qItem = QueryNew("");
var _product = "";
var _result = {};
var _sku = "";
//check init() function has been run if not run it
if NOT structKeyExists(variables,'instance') {
init();
}
_product = getProductObject();
/*
Each file must be named [Part Number].[file extension], so, \
parse the file name to get everything before the file extension
*/
_sku =
Trim(
REQUEST.UDFLib.File.getFileNameWithoutExtension(
ARGUMENTS.FileName
)
);
</cfscript>
<cfif Len(_sku) GT 20>
<cfthrow
message="#ARGUMENTS.FileName#: File Name does not correspond to an existing Part Number." />
</cfif>
<cfset _qItem = _product.readSKU(_sku) />
<cfif NOT _qItem.RECORDCOUNT>
<cfthrow
message="#ARGUMENTS.FileName#: File Name does not correspond to an existing Part Number." />
</cfif>
<cfscript>
FileCopy(ARGUMENTS.FileData, _tempFilePath);
_aMessages =
_product.setId(
_qItem.SKU
).updateThumbnailImages(uploadFilePath = _tempFilePath);
</cfscript>
<cfif ArrayLen(_aMessages)>
<cfthrow
message="#ARGUMENTS.FileName#: #_aMessages[1].getText()#" />
</cfif>
<cfscript>
_result["SKU"] = _product.getSKU();
_result["SMALLIMAGESRC"] = _product.getSmallImageSrc();
_result["LARGEIMAGESRC"] = _product.getLargeImageSrc();
ArrayAppend(_response.data, _result);
</cfscript>
<cfreturn _response />
</cffunction>

Openlaszlo 5.0.x getattribute, rotation

I am working on an animation. I am using .swf pictures which I rotate with code like below.
My problem is: I want to read the actual rotation angel or position of the view "MoAuxid" when I klick on button "Abfrage". How can I get this result?
Best regards
Main Program:
<Mond width="400" height="400">
<view name="Bedienung_rot" x="800" y="10">
<simplelayout axis="y" inset="8"/>
<text text="Output:"/>
<edittext id="outputID" text = "0"/>
<text text="Arc:"/>
<edittext id="WinkelID" text = "51"/>
<button x="000" y="160">
Rotation
<!-- Handler to execute the Method -->
<handler name="onclick">
var x = WinkelID.getText();
MoAuxid.rotate(x);
outputID.setAttribute('text',x);
</handler>
</button>
<text text="Output2:"/>
<edittext id="output2ID" text = "x"/>
<button x="000" y="160">
Abfrage
<!-- Handler to execute the Method -->
<handler name="onclick">
var x = MoAuxid.getAttribute('y');
output2ID.setAttribute('text',x);
</handler>
</button>
</view>
</Mond>
The Mond4.lzx includes the following code:
<!-- IMAGE RESOURCES -->
<resource name="Mo_Bkgnd" src="images/Kalender.jpg" />
<resource name="Mo_Aux" src="images/Mo_Zeiger_Aux.swf" />
<!-- CLASS: Mond -->
<class name="Mond" resource="Mo_Bkgnd">
<attribute name="stretches" value="both"/>
<attribute name="width" value="${this.unstretchedwidth *.5}"/>
<attribute name="height" value="${this.width}"/>
<attribute name="act_height" value="${this.unstretchedheight}"/>
<attribute name="act_width" value="${this.unstretchedwidth}" />
<attribute name="lasthour" value="00" />
<attribute name="lastminute" value="00" />
<attribute name="timezoneoffset" value="00" />
<attribute name="StdZeigWinkel" value="00" />
<attribute name="TagNachtWinkel" value="00" />
<attribute name="kalZeigWinkel" value="20" />
<attribute name="JahresWinkel" value="00" />
<attribute name="FeiertWinkel" value="00" />
<!-- Aux Zeiger -->
<view name="MoAux" resource="Mo_Aux" x="200" y="201" opacity="1" id="MoAuxid">
<method name="rotate" args="Arc">
var rotincrement = 0 + Arc;
var dur = 0;
this.animate('rotation',rotincrement,dur);
</method>
</view>
</class>

GridPane: RowConstraints percentHeight not working as expected

Having a GridPane with 2 rows and 2 columns, setting the row constraints to 50 percent height results in unwanted behaviour.
Code:
<BorderPane xmlns:fx="http://javafx.com/fxml" fx:controller="..." stylesheets="#general.css" prefWidth="800" prefHeight="600">
<top>
<VBox>
<!-- ... -->
</VBox>
</top>
<bottom>
<HBox>
<!-- ... -->
</HBox>
</bottom>
<center>
<GridPane >
<children>
<ScrollPane fx:id="tilePane" GridPane.columnIndex="0" GridPane.rowIndex="0">
<content>
</content>
<GridPane.margin>
<Insets bottom="2" left="2" right="2" top="2" />
</GridPane.margin>
</ScrollPane>
<TreeView fx:id="listPane" GridPane.columnIndex="0" GridPane.rowIndex="1">
<root>
<TreeItem value="Stages" />
</root>
<GridPane.margin>
<Insets bottom="2" left="2" right="2" top="2" />
</GridPane.margin>
</TreeView>
<ScrollPane fx:id="mapPane" GridPane.columnIndex="1" GridPane.rowIndex="0" GridPane.rowSpan="2">
<content>
</content>
<GridPane.margin>
<Insets bottom="2" left="2" right="2" top="2" />
</GridPane.margin>
</ScrollPane>
</children>
<columnConstraints>
<ColumnConstraints hgrow="ALWAYS" percentWidth="25"/>
<ColumnConstraints hgrow="ALWAYS" />
</columnConstraints>
<rowConstraints>
<RowConstraints vgrow="ALWAYS" percentHeight="50" />
<RowConstraints vgrow="ALWAYS" percentHeight="50" />
</rowConstraints>
</GridPane>
</center>
</BorderPane>
(mentioned attribute at the bottom)
I expected that the two rows would share their available height at a 50% rate. They do this, but they also consume a lot more space than needed.
Picture of the result with, and without percentHeight specified:
Do I understand percentHeight wrong, or is there another approach?

Resources