Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop #7

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
166 changes: 97 additions & 69 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,104 +1,132 @@
group 'com.onexip'
version '0.1.5.3-SNAPSHOT'

task wrapper(type: Wrapper) {
gradleVersion = '4.2.1'
plugins {
id 'java-library'
}

apply plugin: 'java'
dependencies {
compile('org.apache.commons:commons-collections4:4.1')

sourceCompatibility = 1.8
implementation 'org.apache.commons:commons-collections4:4.1'

repositories {
mavenCentral()
maven {
url "http://mix-software.com:8081/nexus/content/repositories/onexip-snapshots"
}
testCompile('com.miglayout:miglayout-javafx:5.1.1-SNAPSHOT')
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile("org.testfx:testfx-core:4.0.8-alpha")
testCompile("org.testfx:testfx-junit:4.0.8-alpha")
}

dependencies {
compile('org.apache.commons:commons-collections4:4.1')

testCompile('com.miglayout:miglayout-javafx:5.1.1-SNAPSHOT')
testCompile group: 'junit', name: 'junit', version: '4.12'
testCompile("org.testfx:testfx-core:4.0.8-alpha")
testCompile("org.testfx:testfx-junit:4.0.8-alpha")
// tag::compileJava[]
ext.moduleName = 'com.onexip.flexboxfx'
compileJava {
inputs.property("moduleName", moduleName)
doFirst {
options.compilerArgs = [
'--module-path', classpath.asPath,
]
classpath = files()
}
}
// end::compileJava[]


group 'com.onexip'
version '0.1.5.4-SNAPSHOT'

task wrapper(type: Wrapper) {
gradleVersion = '4.9'
}

apply plugin: 'java'

sourceCompatibility = 1.9
targetCompatibility = 1.9

repositories {
mavenCentral()
mavenLocal()
maven {
url "http://mix-software.com:8081/nexus/content/repositories/onexip-snapshots"
}
}


apply plugin: 'maven'
apply plugin: 'signing'
/*apply plugin: 'signing'*/

if (project.hasProperty("signing.keyId")) {
apply plugin: 'signing'
signing {
sign configurations.archives
}
}

task javadocJar(type: Jar) {
classifier = 'javadoc'
from javadoc
classifier = 'javadoc'
/* from javadoc*/
from javadoc.destinationDir
}

task sourcesJar(type: Jar) {
classifier = 'sources'
from sourceSets.main.allSource
classifier = 'sources'
from sourceSets.main.allSource
}

artifacts {
archives javadocJar, sourcesJar
archives javadocJar, sourcesJar
}


signing {
sign configurations.archives
}
/*signing {
sign configurations.archives
}*/

def isReleaseBuild() {
return version.contains("SNAPSHOT") == false
return version.contains("SNAPSHOT") == false
}


uploadArchives {
repositories {
mavenDeployer {

beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}

snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: ossrhUsername, password: ossrhPassword)
}

pom.project {
name 'FlexBoxFX'
packaging 'jar'
// optionally artifactId can be defined here
description 'port of CSS3 FlexBox'
//url 'http://www.example.com/example-application'

scm {
connection 'scm:git:[email protected]:UltraMixer/FlexBoxFX.git'
developerConnection 'scm:git:https://github.com/UltraMixer/FlexBoxFX.git'
url 'https://github.com/UltraMixer/FlexBoxFX'
}

licenses {
license {
name 'The Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}

developers {
developer {
id 'tobiasbley'
name 'Tobias Bley'
email '[email protected]'
}
repositories {
mavenDeployer {

beforeDeployment { MavenDeployment deployment -> signing.signPom(deployment) }

repository(url: "https://oss.sonatype.org/service/local/staging/deploy/maven2/") {
authentication(userName: findProperty('ossrhUsername'), password: findProperty('ossrhPassword'))
}

snapshotRepository(url: "https://oss.sonatype.org/content/repositories/snapshots/") {
authentication(userName: findProperty('ossrhUsername'), password: findProperty('ossrhPassword'))
}

pom.project {
name 'FlexBoxFX'
packaging 'jar'
// optionally artifactId can be defined here
description 'port of CSS3 FlexBox'
//url 'http://www.example.com/example-application'

scm {
connection 'scm:git:[email protected]:UltraMixer/FlexBoxFX.git'
developerConnection 'scm:git:https://github.com/UltraMixer/FlexBoxFX.git'
url 'https://github.com/UltraMixer/FlexBoxFX'
}

licenses {
license {
name 'The Apache License, Version 2.0'
url 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}

developers {
developer {
id 'tobiasbley'
name 'Tobias Bley'
email '[email protected]'
}
}
}
}
}
}
}
}

Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
3 changes: 2 additions & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#Wed Aug 08 09:23:46 BRT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-all.zip
8 changes: 5 additions & 3 deletions src/main/java/com/onexip/flexboxfx/FlexBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -345,8 +345,10 @@ public int compare(FlexBoxItem item1, FlexBoxItem item2)

for (FlexBoxItem flexBoxItem : nodesList)
{
double nodeWidth = Math.max(growWidth, flexBoxItem.minWidth);
nodeWidth = flexBoxItem.minWidth;

//double nodeWidth = Math.max(growWidth, flexBoxItem.minWidth);
double nodeWidth = flexBoxItem.minWidth;

minWidthSum += nodeWidth;

//is there one more node?
Expand All @@ -360,7 +362,7 @@ public int compare(FlexBoxItem item1, FlexBoxItem item2)
row++;
flexBoxRow = new FlexBoxRow();
addToGrid(row, flexBoxRow);
minWidthSum = 0;
minWidthSum = nodeWidth; //0; bug with 0
}
flexBoxRow.rowMinWidth += flexBoxItem.minWidth;
flexBoxRow.flexGrowSum += flexBoxItem.grow;
Expand Down
6 changes: 6 additions & 0 deletions src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module com.onexip.flexboxfx {
requires javafx.graphics;
requires transitive commons.collections4;

exports com.onexip.flexboxfx;
}
29 changes: 29 additions & 0 deletions src/test/java/com/onexip/flexboxfx/test/TestItemsGrowPercents.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.onexip.flexboxfx.test;

import javafx.application.Application;
import javafx.fxml.FXMLLoader;
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.stage.Stage;

/**
* Created by TB on 11.10.16.
*/
public class TestItemsGrowPercents extends Application
{
public void start(Stage primaryStage) throws Exception
{
Parent root = null;
FXMLLoader loader = new FXMLLoader(getClass().getResource("TestItemsGrowPercents.fxml"));
root = loader.load();
Scene scene = new Scene(root);

primaryStage.setScene(scene);
primaryStage.show();
}

public static void main(String[] args)
{
launch(args);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0" encoding="UTF-8"?>

<?import com.onexip.flexboxfx.*?>
<?import javafx.scene.control.*?>
<?import org.tbee.javafx.scene.layout.fxml.MigPane?>
<MigPane
xmlns:fx="http://javafx.com/fxml"
fx:id=""
stylesheets="@skin.css"
prefWidth="800" prefHeight="300"
layout="ins 0,flowy" cols="[fill,grow]" rows="[][]push"
>
<FlexBox fx:id="flexBoxPane" horizontalSpace="20" verticalSpace="20" styleClass="flex-pane" direction="COLUMN">
<Button text="flex-grow: 1" styleClass="item,item1" FlexBox.grow="100"></Button>
<Button text="flex-grow: 2" styleClass="item,item2" FlexBox.grow="50"></Button>
<Button text="flex-grow: 1" styleClass="item,item3" FlexBox.grow="50"></Button>
</FlexBox>

<!-- <FlexBox fx:id="flexBoxPane2" horizontalSpace="20" verticalSpace="20" styleClass="flex-pane" direction="ROW">
<Button text="flex-grow: 45%" styleClass="item,item1" FlexBox.grow="45"></Button>
<Button text="flex-grow: 45%" styleClass="item,item2" FlexBox.grow="45"></Button>
<Button text="flex-grow: 10%" styleClass="item,item3" FlexBox.grow="10"></Button>
</FlexBox>-->
</MigPane>