Navigation Menu

Skip to content

Commit

Permalink
Update.
Browse files Browse the repository at this point in the history
  • Loading branch information
dim-s committed Nov 26, 2016
1 parent bc60a24 commit cac26f2
Show file tree
Hide file tree
Showing 41 changed files with 762 additions and 37 deletions.
6 changes: 5 additions & 1 deletion build.gradle
Expand Up @@ -205,7 +205,11 @@ project(':jphp-app-framework') {
}

project(':develnext') {
apply plugin: 'application'

dependencies {
compile "org.develnext.jphp:jphp-core:$jphpVersion"

compile project(':develnext-launcher')
compile project(':develnext-designer')
compile project(':jphp-gui-richtext-ext')
Expand All @@ -231,7 +235,7 @@ project(':develnext') {
provided project(':develnext-bundles/dn-pgsql-bundle')
provided project(':develnext-bundles/dn-game2d-bundle')
provided project(':develnext-bundles/dn-systemtray-bundle')
provided project(':develnext-bundles/dn-controlfx-bundle')
//provided project(':develnext-bundles/dn-controlfx-bundle')

// stubs.
compile project(':develnext-stubs/dn-php-sdk')
Expand Down
4 changes: 2 additions & 2 deletions develnext-bundles/dn-controlfx-bundle/.resource
Expand Up @@ -2,7 +2,7 @@ name=ControlFX
description=Пакет дополнительных UI компонентов.
descriptionFile=develnext/bundle/controlfx/description.html
group=other
icon=develnext/bundle/controlfx/controlfx.png
icon=icons/develnext/bundle/controlfx/controlfx32.png

class=develnext\\bundle\\controlfx\\Game2DBundle
class=develnext\\bundle\\controlfx\\ControlFXBundle
author=DevelNext
4 changes: 4 additions & 0 deletions develnext-bundles/dn-controlfx-bundle/build.gradle
Expand Up @@ -6,6 +6,10 @@ repositories {
mavenCentral()
}

sourceSets {
main.resources.srcDirs = ['src']
}

dependencies {
compile (project(':jphp-gui-controlfx-ext')) {
exclude group: 'org.develnext', module: 'jphp-gui-ext'
Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,5 @@
ide\formats\form\elements\ControlFXRatingFormElement
ide\formats\form\elements\ControlFXToggleSwitchFormElement

ide\formats\form\tags\ControlFXRatingFormElementTag
ide\formats\form\tags\ControlFXToggleSwitchFormElementTag
@@ -0,0 +1,58 @@
<?php
namespace develnext\bundle\controlfx;

use ide\bundle\AbstractBundle;
use ide\bundle\AbstractJarBundle;
use ide\formats\GuiFormFormat;
use ide\Ide;
use ide\library\IdeLibraryBundleResource;
use ide\project\behaviours\GuiFrameworkProjectBehaviour;
use ide\project\Project;
use php\desktop\Runtime;
use php\xml\DomDocument;

class ControlFXBundle extends AbstractJarBundle
{
public function isAvailable(Project $project)
{
return $project->hasBehaviour(GuiFrameworkProjectBehaviour::class);
}

public function onAdd(Project $project, AbstractBundle $owner = null)
{
parent::onAdd($project, $owner);

/** @var GuiFormFormat $format */
$format = Ide::get()->getRegisteredFormat(GuiFormFormat::class);

if ($format) {
/*$format->getDumper()->on('appendImports', function ($nodes, DomDocument $document) {
$import = $document->createProcessingInstruction('import', 'org.controlsfx.control.*');
$document->insertBefore($import, $document->getDocumentElement());
}, __CLASS__);*/

$format->registerInternalList('.dn/bundle/controlfx/formComponents');
}
}

public function onRemove(Project $project, AbstractBundle $owner = null)
{
parent::onRemove($project, $owner);

/** @var GuiFormFormat $format */
$format = Ide::get()->getRegisteredFormat(GuiFormFormat::class);

if ($format) {
$format->getDumper()->off('appendImports', __CLASS__);
$format->unregisterInternalList('.dn/bundle/controlfx/formComponents');
}
}

public function onRegister(IdeLibraryBundleResource $resource)
{
parent::onRegister($resource);

Runtime::addJar($resource->getPath() . "/controlsfx.jar");
Runtime::addJar($resource->getPath() . "/jphp-gui-controlfx-ext.jar");
}
}
@@ -0,0 +1,47 @@
<?php
namespace ide\formats\form\elements;

use ide\formats\form\AbstractFormElement;
use php\gui\event\UXMouseEvent;
use php\gui\UXNode;
use php\gui\UXPlusMinusSlider;
use php\gui\UXRating;
use php\gui\UXSlider;

class ControlFXPlusMinusSliderFormElement extends AbstractFormElement
{
public function getGroup()
{
return 'ControlFX';
}

public function getName()
{
return '+/- Ползунок';
}

public function getIcon()
{
return "icons/slider16.png";
}


public function isOrigin($any)
{
return $any instanceof UXPlusMinusSlider;
}

public function getIdPattern()
{
return "slider%s";
}

/**
* @return UXNode
*/
public function createElement()
{
$slider = new UXPlusMinusSlider();
return $slider;
}
}
@@ -0,0 +1,11 @@
<element extends="NodeFormElement">
<properties>
<property code="orientation" name="Ориентация" editor="enum">
<variants>
<variant value="HORIZONTAL">Горизонтальная</variant>
<variant value="VERTICAL">Вертикальная</variant>
</variants>
</property>
<property code="value" name="Значение" editor="floatSlider" min="-1" max="1" tooltip="Значение по-умолчанию" />
</properties>
</element>
@@ -0,0 +1,45 @@
<?php
namespace ide\formats\form\elements;

use ide\formats\form\AbstractFormElement;
use php\gui\event\UXMouseEvent;
use php\gui\UXNode;
use php\gui\UXRating;

class ControlFXRatingFormElement extends AbstractFormElement
{
public function getGroup()
{
return 'ControlFX';
}

public function getName()
{
return 'Рейтинг';
}

public function getIcon()
{
return "icons/develnext/bundle/controlfx/rating16.png";
}


public function isOrigin($any)
{
return $any instanceof UXRating;
}

public function getIdPattern()
{
return "rating%s";
}

/**
* @return UXNode
*/
public function createElement()
{
$rating = new UXRating();
return $rating;
}
}
@@ -0,0 +1,9 @@
<element extends="NodeFormElement">
<properties>
<property code="max" name="Максимум" editor="integer" tooltip="Количество звезд в рейтинге" />
<property code="value" name="Значение" editor="float" tooltip="Значение рейтинга по-умолчанию" />

<property code="partialRating" name="Частичный" editor="boolean" tooltip="Значение рейтинга может быть не целым" />
<property code="updateOnHover" name="Менять при наведении" editor="boolean" tooltip="Менять рейтинг при наведении курсором" />
</properties>
</element>
@@ -0,0 +1,50 @@
<?php
namespace ide\formats\form\elements;

use ide\formats\form\AbstractFormElement;
use php\gui\event\UXMouseEvent;
use php\gui\UXNode;
use php\gui\UXRating;
use php\gui\UXToggleSwitch;

class ControlFXToggleSwitchFormElement extends AbstractFormElement
{
public function getGroup()
{
return 'ControlFX';
}

public function getName()
{
return 'Переключатель';
}

public function getIcon()
{
return "icons/develnext/bundle/controlfx/toggleSwitch16.png";
}


public function isOrigin($any)
{
return $any instanceof UXToggleSwitch;
}

public function getIdPattern()
{
return "toggleSwitch%s";
}

/**
* @return UXNode
*/
public function createElement()
{
return new UXToggleSwitch();
}

public function getDefaultSize()
{
return [32, 16];
}
}
@@ -0,0 +1,5 @@
<element extends="LabeledFormElement">
<properties>
<property code="selected" name="Выделенный" editor="boolean" />
</properties>
</element>
@@ -0,0 +1,34 @@
<?php
namespace ide\formats\form\tags;

use ide\formats\form\AbstractFormDumper;
use ide\formats\form\AbstractFormElementTag;
use php\game\UXGameBackground;
use php\gui\UXButton;
use php\gui\UXImageArea;
use php\gui\UXImageView;
use php\gui\UXPlusMinusSlider;
use php\gui\UXRating;
use php\xml\DomDocument;
use php\xml\DomElement;

class ControlFXPlusMinusSliderFormElementTag extends AbstractFormElementTag
{
public function getTagName()
{
return 'org.controlsfx.control.PlusMinusSlider';
}

public function getElementClass()
{
return UXPlusMinusSlider::class;
}

public function writeAttributes($node, DomElement $element)
{
/** @var UXPlusMinusSlider $node */

$element->setAttribute('orientation', $node->orientation);
$element->setAttribute('value', $node->value);
}
}
@@ -0,0 +1,36 @@
<?php
namespace ide\formats\form\tags;

use ide\formats\form\AbstractFormDumper;
use ide\formats\form\AbstractFormElementTag;
use php\game\UXGameBackground;
use php\gui\UXButton;
use php\gui\UXImageArea;
use php\gui\UXImageView;
use php\gui\UXRating;
use php\xml\DomDocument;
use php\xml\DomElement;

class ControlFXRatingFormElementTag extends AbstractFormElementTag
{
public function getTagName()
{
return 'org.controlsfx.control.Rating';
}

public function getElementClass()
{
return UXRating::class;
}

public function writeAttributes($node, DomElement $element)
{
/** @var UXRating $node */

$element->setAttribute('orientation', $node->orientation);
$element->setAttribute('partialRating', $node->partialRating ? 'true' : 'false');
$element->setAttribute('updateOnHover', $node->updateOnHover ? 'true' : 'false');
$element->setAttribute('rating', $node->value);
$element->setAttribute('max', $node->max);
}
}
@@ -0,0 +1,33 @@
<?php
namespace ide\formats\form\tags;

use ide\formats\form\AbstractFormDumper;
use ide\formats\form\AbstractFormElementTag;
use php\game\UXGameBackground;
use php\gui\UXButton;
use php\gui\UXImageArea;
use php\gui\UXImageView;
use php\gui\UXRating;
use php\gui\UXToggleSwitch;
use php\xml\DomDocument;
use php\xml\DomElement;

class ControlFXToggleSwitchFormElementTag extends AbstractFormElementTag
{
public function getTagName()
{
return 'org.controlsfx.control.ToggleSwitch';
}

public function getElementClass()
{
return UXToggleSwitch::class;
}

public function writeAttributes($node, DomElement $element)
{
/** @var UXToggleSwitch $node */

$element->setAttribute('selected', $node->selected ? 'true' : 'false');
}
}

0 comments on commit cac26f2

Please sign in to comment.