TableSelectionModel when new rows are added

2019-06-25 Thread Alex Sviridov
Hi all,

I am learning JavaFX API and can't understand how row indexes change
when new rows are added to the table. Suppose, there are 3 rows in the table and
row[2] is selected. When a new row is added at the beginning of the table then 
selected 
row index must change to 3. Could anyone explain how indexes are updated (the 
only methods 
I see are clearAndSelect but they are not good from viewpoint of performance)?

By the way, could anyone say, why table was called TableView? I ask
because there are TableColumn, TablePosition, TableCell but no Table.


-- 
Best regards, Alex Sviridov

TableSelectionModel in javadoc and in sources

2019-06-25 Thread Alex Sviridov
Hi all,

I am reading JavaFX API and came across the following problem about 
TableSelectionModel

In javadoc ( 
https://openjfx.io/javadoc/11/javafx.controls/javafx/scene/control/TableSelectionModel.html
 ):

Module javafx.controls
Package javafx.scene.control
...
public abstract class TableSelectionModel extends MultipleSelectionModel

In javafx-11+14-sources:

package javafx.scene.control;
public abstract class TableSelectionModel extends 
MultipleSelectionModelBase {

as we see TableSelectionModel extends different classes in source and javadoc. 
Could anyone explain it?

-- 
Best regards, Alex Sviridov

Why does Skin have getNode method instead of getControl?

2019-05-03 Thread Alex Sviridov
Hi all,

In my previous message I asked why GridPane, HBox, BorderPane, VBox, StackPane 
don't have Skins. I was told that it is odd for them to have Skins ( Kevin 
Rushforth )
and only controls can have skins. 

I pointed, that every Node can have a Skin, but got no answer.

Now I am reading Skin API and see there the following method:

Node getNode()  Gets the Node which represents this Skin.

The Skinnable interface is implemented by the Control class, and therefore is 
implemented
by all Control implementations.

So, could anyone explain why in Skin we have `Node getNode()` but not `Control 
getControl()`.


-- 
Alex Sviridov

Re[2]: Why don't GridPane, HBox, BorderPane, VBox, StackPane have Skins?

2019-04-29 Thread Alex Sviridov
Hi Kevin,

Let me explain the reasons of this question. We implement JavaFX (simplified) 
in TypeScript 
( https://github.com/PavelKastornyy/script4j ) for web. For every JavaFX Node 
we have
html element. For example, for Pane we have . 

So the question, where should we put all the logic about html elements of the 
Node? 
We thought that Skin is the best candidate, however, we found that not all 
nodes have Skins,
for example GridPane doesn't. What would you advise?


>Пятница, 26 апреля 2019, 17:46 +03:00 от Kevin Rushforth 
>:
>
>Those are layout containers, not UI controls. Given their purpose -- to 
>be containers for laying out children -- it would seem odd for them to 
>have skins. The ability to CSS-style a Pane should be sufficient to do 
>what you want.
>
>-- Kevin
>
>
>On 4/26/2019 6:13 AM, Alex Sviridov wrote:
>> I am studying JavaFX API and can't understand why GridPane, HBox, 
>> BorderPane, VBox, StackPane don't have Skins. According to Skin API doc:
>>> Base class for defining the visual representation of user interface 
>>> controls by defining a scene graph of nodes to represent the skin. A user 
>>> interface control is abstracted behind the Skinnable interface.
>> Why do JavaFX developers use skins only for controls, but not for the above 
>> panes? I am asking, because these panes also have visual representation. For 
>> example, we can set color, they have children which can be placed somehow 
>> differently etc. Could anyone explain?
>


-- 
Alex Sviridov


Re[2]: Why don't GridPane, HBox, BorderPane, VBox, StackPane have Skins?

2019-04-26 Thread Alex Sviridov
Hi Kevin, thank you for your answer. 

Skin, as I understand, is a visual representation. You write - `The ability to 
CSS-style a 
Pane should be sufficient to do what you want`. So, on one side is a Skin that 
is a visual 
representation, on the other hand we can change visual representation of Pane 
via CSS. 
However, it is odd for Panes to have Skins. There is no logic for me here. For 
me it is
odd for Panes not to have Skins. Or I understand something wrong.


>Пятница, 26 апреля 2019, 17:46 +03:00 от Kevin Rushforth 
>:
>
>Those are layout containers, not UI controls. Given their purpose -- to 
>be containers for laying out children -- it would seem odd for them to 
>have skins. The ability to CSS-style a Pane should be sufficient to do 
>what you want.
>
>-- Kevin
>
>
>On 4/26/2019 6:13 AM, Alex Sviridov wrote:
>> I am studying JavaFX API and can't understand why GridPane, HBox, 
>> BorderPane, VBox, StackPane don't have Skins. According to Skin API doc:
>>> Base class for defining the visual representation of user interface 
>>> controls by defining a scene graph of nodes to represent the skin. A user 
>>> interface control is abstracted behind the Skinnable interface.
>> Why do JavaFX developers use skins only for controls, but not for the above 
>> panes? I am asking, because these panes also have visual representation. For 
>> example, we can set color, they have children which can be placed somehow 
>> differently etc. Could anyone explain?
>


-- 
Alex Sviridov


Why don't GridPane, HBox, BorderPane, VBox, StackPane have Skins?

2019-04-26 Thread Alex Sviridov

I am studying JavaFX API and can't understand why GridPane, HBox, BorderPane, 
VBox, StackPane don't have Skins. According to Skin API doc:
>Base class for defining the visual representation of user interface controls 
>by defining a scene graph of nodes to represent the skin. A user interface 
>control is abstracted behind the Skinnable interface.
Why do JavaFX developers use skins only for controls, but not for the above 
panes? I am asking, because these panes also have visual representation. For 
example, we can set color, they have children which can be placed somehow 
differently etc. Could anyone explain?
-- 
Alex Sviridov

https://bugs.openjdk.java.net/browse/JDK-8092297

2018-10-17 Thread Alex Sviridov
Dear JavaFX developers

Seven years ago this issue https://bugs.openjdk.java.net/browse/JDK-8092297 was 
opened 
suggesting to add serialization of javafx properties. Seven years have passed 
and we still
don't have it. I think you should not harry. We still can wait many years - 10, 
20 etc. So that's ok.


-- 
Alex Sviridov

TextArea doesn't scroll to bottom when texts becomes long and vertical scrollbar appears JDK-8189732

2018-05-08 Thread Alex Sviridov
More then half a year ago I opened an issue  
https://bugs.openjdk.java.net/browse/JDK-8189732  
that TextArea doesn't scroll to bottom when texts becomes long and vertical 
scrollbar appears.

The issue is still not resolved and even fix version is not defined. Could 
anyone say the reason
of this? It is very strange as such issues must be resolved very quickly. 


-- 
Alex Sviridov

Tab with rounded corners strange behaviour bug

2015-08-15 Thread Alex Sviridov
 Hello.

I wrote to this mailing list about problem with rounded corners in tabs. They 
advised me to fire a bug at oracle official site. I did this way on 14 July 
2015 (ONE MONTH AGO). And I got:

We are evaluating this report and have assigned it a Review ID: JI-9022330. In 
the event this report is determined to be a defect or enhancement request, it 
will be referenced with a new Bug ID and will be listed on Bugs.java.com. For 
other related issues, please visit our Bug Database at  http://bugs.java.com .

On 20 July 2015 I got message from  pardeep.k.sha...@oracle.com asking for full 
tests. I send him all test on 23 July 2015. And nothing from that time.On 28 
July 2015 I sent him an email asking what is next but got no answer.

What should I do now? How can I understand what with this bug?


-- 
Alex Sviridov

Tab with rounded corners strange behaviour bug

2015-07-14 Thread Alex Sviridov
 I want to make tabs big with rounded corners. And this is my css file:

The final target to make tab headers bigger with rounded corners.
.tab:selected .focus-indicator {
-fx-border-radius:101000,101000;
-fx-border-insets:-7-7-9-8,-5-5-9-6;}

.tab-pane .tab-header-area .headers-region .tab:selected{
-fx-border-insets:10101010,10101010;}

.tab-pane .tab-header-area .headers-region .tab .tab-container .tab-label {
-fx-alignment: CENTER;
-fx-text-fill:-fx-text-base-color;
-fx-padding:01000;}

.tab-header-area .tab{
-fx-padding:410510;
-fx-border-radius:101000;
-fx-background-radius:101000;
}

However, some strange elements appear near corners and later appear. It can be 
seen on the following images:
http://i.stack.imgur.com/kyICa.jpg
http://i.stack.imgur.com/0mnDq.jpg

I asked this question at stackoverflow  
http://stackoverflow.com/questions/30690918/javafx-tab-rounded-corners/30692660#30692660
and one user said that this is Changing CSS Id at run-time on Tab does not 
result in changing style bug 
https://bugs.openjdk.java.net/browse/JDK-8090243

However, I am not sure that this is the bug I am talking about as css rules are 
not set at runtime. This bug is important for me
that's why I want to be sure that THIS bug is my problem. Please say, if this 
bug is my problem.


-- 
Alex Sviridov

JavaFx8: One controller, two fxml,factory and @FXML problem - bug or limit

2015-07-05 Thread Alex Sviridov
 I've read the following from her e 
https://docs.oracle.com/javase/8/javafx/fxml-tutorial/jfx2_x-features.htm

When a controller factory is provided to the  FXMLLoader object, the loader 
will delegate controller construction to the factory. An implementation might 
return a null value to indicate that it does not or cannot create a controller 
of the given type; in this case, the default controller construction mechanism 
will be employed by the loader. Implementations might also recycle 
controllers such that controller instances can be shared by multiple FXML 
documents. However, developers must be aware of the implications of doing this: 
primarily, that controller field injection should not be used in this case 
because it will result in the controller fields containing values from only the 
most recently loaded document.

As I understood it is the feature of javafx2. But what about javafx8? I did the 
following test:

public class Test1Controller {
    @FXML
    public Button Test1Button; 
    
    @FXML
    public void onTest1Button(){
    System.out.println(TEST1 BUTTON IS PRESSED+Test1Button.getText());
    }
}

public class Test2Controller extends Test1Controller{
    @FXML
    public Button Test2Button;
    
    @FXML
    private void onTest2Button(){
    System.out.println(TEST2 BUTTON IS 
PRESSED+Test2Button.getText()+Test1Button.getText());
 }
 }

test1.fxml
AnchorPane maxHeight=-Infinity fx:id=Test1Pane maxWidth=-Infinity 
minHeight=-Infinity minWidth=-Infinity prefHeight=400.0 prefWidth=600.0 
xmlns=http://javafx.com/javafx/8.0.45; xmlns:fx=http://javafx.com/fxml/1; 
fx:controller=temp.Test1Controller
   children
  Button fx:id=Test1Button layoutX=300.0 layoutY=40.0 
mnemonicParsing=false onAction=#onTest1Button text=Test1 /
   /children
/AnchorPane

test2.fxml

the main code:
    @Inject
    private FXMLLoader fxmlLoader1;
    
    @Inject
    private FXMLLoader fxmlLoader2;

   private Test2Controller testController=new Test2Controller();
    
    @FXML
    private void handleOkButtonAction(ActionEvent event) throws IOException {
    
    CallbackClass?, Object controllerFactory = type - {
    return testController ;
    }; 
    fxmlLoader1.setControllerFactory(controllerFactory);
    fxmlLoader2.setControllerFactory(controllerFactory);
    Parent parent2 = (Parent)fxmlLoader2.load(getFxmlStream(test2.fxml));
    Parent parent1 = (Parent)fxmlLoader1.load(getFxmlStream(test1.fxml)); 
    mainAnchorPane.getChildren().addAll(parent1,parent2);

As the result - I have two button on anchor pane. However, the Test1Button 
doesn't have action handler so it is not clickable. What about Test2Button it 
works ok and when I click it I get:
TEST2 BUTTON IS PRESSED Test2 Test1
It means that Test1Button was also injected. Besides I've noticed that if add 
firstly to pane parent2 and then parent1 -  
mainAnchorPane.getChildren().addAll(parent2,parent1); then
Test1Button works, but Test2Button is not clickable. 

Why only one of handlers works? This is a bug in javafx8 or this is limitation? 


-- 
Alex Sviridov

comboBox.setValue and ActionEvent cycle

2015-06-30 Thread Alex Sviridov

I have combobox with page numbers (1,2,3,etc). When user select the certain 
page (by mouse or by keyboard(as combobox editable)) 
I  want to show and total pages. That's why on combobox action I do:
@FXMLprivatevoid onPageComboBoxAction(ActionEvent event){

   combobox.setValue(currentPage+/+totalPages)

} However this code ( combobox . setValue ) fires one more ActionEvent and code 
cycles. I tried to use swithers like boolean ignoreActionEvent but it didn't 
work as it seems event is handled in different thread.

How to solve such problem? 

P.S. I understand that this problem is for user mailing list but I ask at 
stackoverflow and get no answer.