Font text changes size on mouseclick in TextField javafx - user-interface

I am facing a problem with javafx TextField. I created my TextField using scene builder and the following code was generated:
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.TextArea?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.StackPane?>
<?import javafx.scene.text.Font?>
<StackPane fx:id="placeHolder" styleClass="pane-with-border" xmlns="http://javafx.com/javafx/8.0.111" xmlns:fx="http://javafx.com/fxml/1">
<HBox prefHeight="37.0" prefWidth="1203.0">
<children>
<TextArea fx:id="resultDisplay" editable="false" prefHeight="154.0" prefWidth="1224.0" styleClass="result-display">
<font>
<Font size="16.0" />
</font></TextArea>
</children>
</HBox>
</StackPane>
I am using this TextField to display results. Hence, I set it to be non-editable. However, once the results have be displayed in this TextField and I click on it, the font-size decreases (as shown below).
When I click on other components in the window, the font-size reverts back to its original size (and the cycle continues).
I have checked my code for any mouse listener events but couldn't find any. So it is not plausible that a mouse event could have caused this problem.
If there is a need to see the actual application and code, my gradle project can be
found here.
Could someone please advise me on how to resolve this issue?

Related

Custom Attribute of Integer on Custom View

I'm having a few problems creating an integer attribute.
So, as background. I have got a custom canvas view. I have already successfully created a custom string attribute on that. The axml looks like this:
<turbineApp.droid.infrastructure.customViews.TurbineMapCanvas
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="#+id/VicMapCanvas"
custom:mapName="VIC"
/>
And the attribute comes from attrs.xml:
<resources>
<declare-styleable name="CustomCanvasView">
<attr name="mapName" format="string" />
</declare-styleable>
</resources>
I was hoping to add an integer attribute. So, I added the following as an element in attrs.xml:
<attr name="originY" format="integer" />
But now the project won't build. At all. With a fail message that the Resources class never got built.
I've unblocked myself by just making it a string and parsing the string in the code. But why will an integer not work? Have the good people at Xamarin not implemented that yet?
Thanks

KML file error: GroundOverlay color change on Google Earth,different from original image

I have this .kml file, which I posted below.On Google Earth .I want to it draws an image overlay draped onto the terrain through using label .I turned to see the color change .I've been working on this for days,but I don't known why. thanks!
The KML file :
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
<GroundOverlay>
<name>DLRSRPall_0.dat</name>
<Icon>
<href>DLRSRPall_0.dat.bmp</href>
</Icon>
<altitude>21</altitude>
<gx:LatLonQuad>
<coordinates>
106.712381310854,26.5706731633437,0
106.72683416117,26.5704986412882,0
106.727023032012,26.5830885391534,0
106.712568602821,26.5832631566659,0
</coordinates>
</gx:LatLonQuad>
</GroundOverlay>
</Document>
</kml>
The image file :
On Google Eatrh:

FXML cellValueFactory for TreeTableColumn

I've been trying to build a Tree Table and define the cellValueFactories in FXML.
When I try this, I get the following error in the stack trace
Exception in thread "JavaFX Application Thread" java.lang.ClassCastException: javafx.scene.control.TreeTableColumn$CellDataFeatures cannot be cast to javafx.scene.control.TableColumn$CellDataFeatures
The FXML is written as follows
<TreeTableView prefHeight="500.0" prefWidth="600.0" fx:id="customerContractsTable">
<columns>
<TreeTableColumn prefWidth="116.0" text="Contract Number">
<cellValueFactory>
<PropertyValueFactory property=""/>
</cellValueFactory>
</TreeTableColumn>
</columns>
</TreeTableView>
I've been trying to find any documentation references on how to do this and am coming up completely empty handed. Any documentation or help would be greatly apperciated.
Here is a sample TreeTableView in FXML.
<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.TreeTableView?>
<?import javafx.scene.control.TreeTableColumn?>
<?import javafx.scene.control.cell.TreeItemPropertyValueFactory?>
<TreeTableView>
<columnResizePolicy>
<TreeTableView fx:constant="CONSTRAINED_RESIZE_POLICY" />
</columnResizePolicy>
<columns>
<TreeTableColumn text="Contract Number">
<cellValueFactory>
<TreeItemPropertyValueFactory property="contractNumber" />
</cellValueFactory>
</TreeTableColumn>
</columns>
</TreeTableView>
See RT-35233.
I think it's a bug, you should log it in the JavaFX issue tracker.
I think the bug is that the TreeTableView does not define it's own builder for defining columns in FXML, so it inherits the functionality from a TableViewBuilder which only defines columns as TableColumns, not TreeTableColumns. This means that TableColumns for straight TableViews can be defined in FXML but, TableColumns for TreeTableViews cannot.
In the meantime, define your cellValueFactories for TreeTables in code (in the initializer for your controller) rather than FXML.
I had the same problem but then checked and changed the imports.
I was building a Dynamic Tableview and had used the "Fix Imports" feature of Netbeans, however I noticed that instead of importing:
javafx.scene.control.TableColumn.CellDataFeatures;
it had imported
javafx.scene.control.TreeTableColumn.CellDataFeatures;
I corrected the import manually and the problem disappeared.

palettes of icons in Google Earth (Mac)

(Cross posted from the GE support groups - now defunct?)
Having trouble using the gs:x extensions to use palettes of icons in an icon
group.
I have loaded the appropriate xmlns:gx="http://www.google.com/kml/ext/2.2"
into the kml header but get the message "Unknown type gs:x
on my Macintosh under GE Google Earth 6.0.3.2197
I suspect this has not been implemented on the Mac version - anybody
with experience on this?
Final code was as follows and it fails on the first gx:s line.
It also fails in the same way if I use the now deprecated x (rather than gx:x)
Also, as shown it follows the kml documentation but I think all terminating terms should be of the form /gx:x rather than gx:x/
as shown in the KML reference. Making that change does not help as it never gets to that point anyway.
The header was copied from a GE placemark copied and pasted into the
editor.
Any help appreciated.
Bob J.
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2"
xmlns:gx="http://www.google.com/kml/ext/2.2"
xmlns:kml="http://www.opengis.net/kml/2.2"
xmlns:atom="http://www.w3.org/2005/Atom">
<Document>
<StyleMap id="s_Ic_SP">
<Pair><key>normal</key><styleUrl>#sn_Ic_SP</styleUrl></Pair>
<Pair><key>highlight</key><styleUrl>#sh_Ic_SP</styleUrl></Pair>
</StyleMap>
<Style id="sn_Ic_SP">
<IconStyle>
<scale>1.8</scale>
<Icon>
<href>Icons/Traps.png</href>
<gx:x>0<gx:x/><gx:y>128<gx:y/> <gx:w>64<gx:w/><gx:h>64<gx:h/>
</Icon>
<hotSpot x="32" y="1" xunits="pixels" yunits="pixels"/>
</IconStyle>
<BalloonStyle>
<displayMode>default</displayMode><bgColor>ff00d0ff</bgColor>
<text><![CDATA[<font face="Comic Sans MS" /><table
bgcolor="#ff8000" cellspacing="3" width="160">
<tr bgcolor="#ffff80"><td><b>Sponsor $[name]</b><br/><br/>$
[description]</td></tr></table>]]></text>
</BalloonStyle>
<LabelStyle>
<scale>0.9</scale><color>ff00ffff</color>
</LabelStyle>
<LineStyle><color>ff00ffff</color><width>2.0</width></LineStyle>
<ListStyle>
<ItemIcon>
<href>Icons/Traps.png</href>
<gx:x>0<gx:x/><gx:y>128<gx:y/> <gx:w>64<gx:w/><gx:h>64<gx:h/>
</ItemIcon>
</ListStyle>
</Style>
etc.
Oooops
Seems my problem was a syntax problem
The gx:x set do work correctly. However, they are not operational inside the ItemIcon group as shown in my example. In fact they are ignored in that group.
Thanks for your tolerance of my stupidity
Bob J.

flex 4.6 background image skinning

Hi everyone I'm new in flash builder with flex 4.6...
I created a mobile app with navigator view theme but I want my own personalized theme which is a simple image jpg attached in my skin: backGround.mxml
<s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:fb="http://ns.adobe.com/flashbuilder/2009" alpha.disabled="0.5">
<fx:Metadata>[HostComponent("spark.components.View")]</fx:Metadata>
<s:states>
<s:State name="normal" />
<s:State name="disabled" />
</s:states>
<s:BitmapImage includeIn="normal" height="100%" source="assets/fondito.jpg" width="100%"/>
I imported the skin as skinClass in my HomeView, but it covers up all the other components... labels, list, buttons, etc...
How can i display all components above the skin?
Take a look at the skinParts that are necessary for the View class here.
You'll notice that you're going to need a contentGroup optional skin part. This allows you to layout your bitmap image relative to that. As a quick fix, here is some sample code (untested):
...
<s:BitmapImage includeIn="normal" height="100%" source="assets/fondito.jpg" width="100%"/>
<s:Group id="contentGroup"/>
...

Resources