How to reversly fill a silder in javafx - javafx

Can the fill of a vertical slider be reversed? As you can see in the figure, the slider is filling from 12, but I want it to be from -24. Is there any solution?
What's happening What i want
12.0 12.0
-
-
- - - - - 0 - - - - - -
-
-
-
-24.0 -24.0
Update : I'm recently using JMetro css stylesheets for my app.

Well, after the link provided by #Uluk Biy I've got the refurnished code, which itself needed a refurnishment. The problem was still not solved.The slider had just been set to its proper vertical orientation but the track was still filling from bottom. Just open FilledSliderSkin.java, go to line 324, and replace the fill.resizeRelocate(x,y,width,height) with the following :
fill.resizeRelocate(trackLeft,
thumb.getLayoutY(),
trackWidth,
((int)trackLength + trackStart - trackRadius) - thumb.getLayoutY());
Now you're done. :)

Related

css is not rendered properly

I'm trying to build a progress bar component where I want to achieve a specific design for that, as you can see how I tried it in this codesandbox link:
https://codesandbox.io/s/determined-lamport-7zjvwj.
I want to achieve the following behavior:
Initially, all dots should be blue except the first one which is rounded in blue.
I want to keep the dots in the progress bar when I change the properties into blue if the percentage didn't cover them otherwise white
But somehow my CSS calculation is not working properly as expected which I believe I missed something, so any ideas?
there is an error in line 60 et 61
const current = steps.indexOf(stepStatus); // issue here probably
const step = steps.indexOf(stepStatus); // issue here probably
should be:
const current = steps.indexOf(progressBarStatus);
const step = steps.indexOf(stepStatus)
In addition to this problem the width of the pourcentages is not accurate, you can fix this by changing the line 51 with:
const progressBarCalculatedWith =
((current / (getIntermediarySteps + 1)) * 100) + (steps.length -1 - current);
this is the result :
working progress bar
Simply use the same calculation that calculates the % for the loading bar, then apply it ont he dots - So that if the value is 25% or more, then the first dot is blue, then an additional 25% and so on etc. It does not have to be interconnected with the rest of the loading bar, it can use the same calculation.
Simply an If / Else basically.

Cannot understand the "Layout forced" section in DevTools performance tab

I am studying the Chrome DevTools Performance Tab based on this article https://developer.chrome.com/docs/devtools/evaluate-performance/.
In step 7, it said "In the Summary tab, click the app.js:70 link under Layout Forced. DevTools takes you to the line of code that forced the layout.", it indicate line 70:
But actually the change of the style should occurs in line 69, i.e.:
m.style.top = pos + 'px';
Why it will highlight line 70 instead?

materialized css HTML5 Range slider doesn't show thumb

I use Materialize: 1.0.0 , no thumb showing on html5 range
If I use Materialize: 0.100.2 and 0.97.3, both works fine do show thumb number.
I can not down-grade to 0.100.2 and 0.97.3,
Because all my other code use,instance M,
for example, M.Tab.... M.xxx....(0.100.2 and 0.97.3 NOT support M.tab..)
We must fix 1.0.0 range thumb issue, but how?
Working code:
depends what version you use:
case 1:
For v1.0.0 failed to show range thrumb, must M.Range.init("input[type=range]")
//for materializ-css v1.0.0 without this range will failed to show thrumb
// for materializ-css v0.100.2 and 0.97.3 works fine without(can NOT use) M.range.init
var array_of_dom_elements = document.querySelectorAll("input[type=range]");
M.Range.init(array_of_dom_elements);
case 2:
For v0.100.2 and v0.97.3 works without (and can NOT use) M.Range.init
v0.100.2 and v0.97.3 do not support M.xxx instance style
I discovered that will works because the materialize.js tag is included immediately before the closing body tag. If I move it to the document head, the thumb doesn't work anymore.
read more at https://github.com/Dogfalo/materialize/issues/6036

Magnolia 5.5.5 ModalityLevel of Component Dialog

As it is written here
https://documentation.magnolia-cms.com/display/DOCS56/Dialog+definition I assume there is a possibility for every dialog to insert the following line into the yaml:
modalityLevel: non-modal
If I do this to an existing Component-Dialog which could be quite complex (with tabs and so on) the console logs an error.
WARN agnolia.config.source.yaml.YamlConfigurationSource: 1 major and 0 minor problems have been encountered
(Note: if I do modalityLevel: light it works..)
The reason I want to do this is to have more than one dialog opened at once.
Is that possible in Magnolia 5.5.5 (or 5.6)?
Okay there we go, after some investigation it turns out that the problem is within Magnolia. I have created the following issue https://jira.magnolia-cms.com/browse/MGNLUI-4328 for the problem. For now please ignore what the definition app says and we will fix it as soon as possible.
Cheers,
FWIW, I get the same behavior on the current demo ...
It's defined here:
info.magnolia.ui.api.overlay.OverlayLayer
65 /**
66 * The available levels of modality.
67 * Determines how "modal" it is -
68 * -STRONG creates a dark background that prevents clicks.
69 * -LIGHT adds a border, creates a transparent background that prevents clicks.
70 * -NON_MODAL does not prevent clicks.
71 */
72 public static enum ModalityLevel {
73 STRONG("strong", "modality-strong"),
74 LIGHT("light", "modality-light center-vertical"),
75 NON_MODAL("non-modal", "modality-non-modal");
And it's used here:
info.magnolia.ui.framework.overlay.OverlayPresenter
216 final OverlayCloser closer = openOverlay(new ViewAdapter(shortcutPanel), ModalityLevel.NON_MODAL);
And it's used here:
info.magnolia.dam.app.assets.field.UploadAssetActionRenderer
155 progressIndicatorCloseHandle = layer.openOverlay(new ViewAdapter(progressIndicator), ModalityLevel.NON_MODAL);
and etc.
So that seems like a false positive.
Interestingly, I don't see any tests for this ... for example, I see:
assertEquals("light", session.getProperty("/modules/ui-framework/dialogs/rename/modalityLevel").getString());
and
assertEquals("strong", session.getProperty("/modules/pages/dialogs/createPage/modalityLevel").getString());
but nothing with "non-modal"
I thought maybe the "-" character, but this appears, all else equal, to be valid yaml
---
modalityLevels: strong
modalityLeveln: non-modal
modalityLevell: light
Would have to dig deeper to see what is happening here.
UPDATE: if you change it to "non_modal", there's no longer an error in the definitions app.

Extract string after first occurrence of a string pattern

I'm having trouble extracting all the text that occurs after the first occurrence of the word 'PRODUCTS'. The text I'm working with is below and is stored in
test$description
(There is more text but R truncates the last part)
[1] "Hey guys! Been wanting to film a Get Ready With Me for a while, just to sit back and chill and chit chat with you all! It has been a MINUTE since I have done one of these so I hope you enjoy this first impressions get ready with me :D Love you guys! \n\nDONT FORGET TO HIT SUBSCRIBE! :D \n---------------------------------------------------------------------------------------------------------------\nFACE PRODUCTS : \n\nH2O Green Tea Matcha Facial Essence - \nMILK Makeup Blur Stick - \nLoreal Total Coverage Foundation - \nGallany Concealer - \n\nBecca Soft Light Powder - \nPixie X Maryam NYC Glow and Bronze Palete - \nClinique Honey Cheek Pop Blush -\n---------------------------------------------------------------------------------------------------------------\nEYE PRODUCTS! \n\nColourpop Pressed Eyeshadows - <truncated>
When I use:
sub(".*PRODUCTS",'',test$description)
I get:
[1] "! \n\nColourpop Pressed Eyeshadows - \n\nTarte Cosmetics Fake Away Pencil - \n\nKat Vond D Trooper Eyeliner - \n\nNubounsom Dragon Li Lashes - Use code MANNYMUA to save 20% - \n---------------------------------------------------------------------------------------------------------------\nLIPS \n\nMorphe Brushes Liquid Lipstick in the shade Mood - USE CODE MANNYMUA to save money -\n--------------------------------------------------------------------------------------------\nBRUSHES AND TOOLS - \n\nMorphe Brushes - use code \"MANNYMUA\" all caps for 10% off everything! - \n- \nMorphe E2 Bronzer Brush - \nMorphe E4 Blush Brush - \nMorphe MB13 Nose Contour - \nMorphe M510 Highlight Brush - \n\nEYES:\nE2... <truncated>
So only everything after the second occurrence of 'PRODUCTS'
When I use: sub(".*PRODUCTS ",'',test$description)
I get:
[1] ": \n\nH2O Green Tea Matcha Facial Essence - \nMILK Makeup Blur Stick - \n\nLoreal Total Coverage Foundation - \nGallany Concealer - \n\nBecca Soft Light Powder - \n\nPixie X Maryam NYC Glow and Bronze Palete - \n\nClinique Honey Cheek Pop Blush - \n\n---------------------------------------------------------------------------------------------------------------\nEYE PRODUCTS! \n\nColourpop Pressed Eyeshadows - \n\nTarte Cosmetics Fake Away Pencil - \n\nKat Vond D Trooper Eyeliner - \n\nNubounsom Dragon Li Lashes - Use code MANNYMUA to save 20% - \n\n---------------------------------------------------------------------------------------------------------------\nLIPS \n\nMorphe Brushes Liquid Lipstick in the shade Mood - USE CODE MANNYMUA to save money... <truncated>
I think the issue is the space between 'PRODUCTS' and the colon in the first occurrence and the lack of space between 'PRODUCTS' and the exclamation point in the second occurrence. But I'm trying to tell R just to look for the string 'PRODUCTS'. How can I get it to ignore the spacing?
You almost had it. Instead use sub(".*?PRODUCTS",'',test$description)
Note added ?, no space after PRODUCTS. By default, the matching is "greedy"; it matches as much as it can, so .*PRODUCTS goes until the last copy of PRODUCTS. Adding the ? turns off greedy matching so it only goes to the first instance.

Resources