Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
762 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+609 Bytes
...controlfx-bundle/src/.data/img/icons/develnext/bundle/controlfx/controlfx32.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+631 Bytes
...dn-controlfx-bundle/src/.data/img/icons/develnext/bundle/controlfx/rating16.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+520 Bytes
...trolfx-bundle/src/.data/img/icons/develnext/bundle/controlfx/toggleSwitch16.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
develnext-bundles/dn-controlfx-bundle/src/.dn/bundle/controlfx/formComponents
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
ide\formats\form\elements\ControlFXRatingFormElement | ||
ide\formats\form\elements\ControlFXToggleSwitchFormElement | ||
|
||
ide\formats\form\tags\ControlFXRatingFormElementTag | ||
ide\formats\form\tags\ControlFXToggleSwitchFormElementTag |
58 changes: 58 additions & 0 deletions
58
develnext-bundles/dn-controlfx-bundle/src/develnext/bundle/controlfx/ControlFXBundle.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"); | ||
} | ||
} |
File renamed without changes.
47 changes: 47 additions & 0 deletions
47
...dn-controlfx-bundle/src/ide/formats/form/elements/ControlFXPlusMinusSliderFormElement.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...dn-controlfx-bundle/src/ide/formats/form/elements/ControlFXPlusMinusSliderFormElement.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
45 changes: 45 additions & 0 deletions
45
...-bundles/dn-controlfx-bundle/src/ide/formats/form/elements/ControlFXRatingFormElement.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} | ||
} |
9 changes: 9 additions & 0 deletions
9
...-bundles/dn-controlfx-bundle/src/ide/formats/form/elements/ControlFXRatingFormElement.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
50 changes: 50 additions & 0 deletions
50
...es/dn-controlfx-bundle/src/ide/formats/form/elements/ControlFXToggleSwitchFormElement.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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]; | ||
} | ||
} |
5 changes: 5 additions & 0 deletions
5
...es/dn-controlfx-bundle/src/ide/formats/form/elements/ControlFXToggleSwitchFormElement.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<element extends="LabeledFormElement"> | ||
<properties> | ||
<property code="selected" name="Выделенный" editor="boolean" /> | ||
</properties> | ||
</element> |
34 changes: 34 additions & 0 deletions
34
.../dn-controlfx-bundle/src/ide/formats/form/tags/ControlFXPlusMinusSliderFormElementTag.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...t-bundles/dn-controlfx-bundle/src/ide/formats/form/tags/ControlFXRatingFormElementTag.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...les/dn-controlfx-bundle/src/ide/formats/form/tags/ControlFXToggleSwitchFormElementTag.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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'); | ||
} | ||
} |
Oops, something went wrong.