-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
revert change by mistake Fix build-bootstrap.xml Simplify configuration of platform tests. No referencing of mps-generated is now allowed in tests. rebuild: update build-bootstrap.xml
- Loading branch information
1 parent
ffb4d2e
commit ab87773
Showing
72 changed files
with
2,507 additions
and
405 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 not shown.
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,7 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip | ||
networkTimeout=10000 | ||
validateDistributionUrl=true | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
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
4 changes: 4 additions & 0 deletions
4
code/cat_visual/src/main/kotlin/canvas/exceptions/Exceptions.kt
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,4 @@ | ||
package canvas.exceptions | ||
|
||
class UnknownTypeItemException(id: String, unresolvedType: String): | ||
RuntimeException("Can't resolve type: $unresolvedType, for id: $id") |
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 @@ | ||
package canvas.items | ||
|
||
import androidx.compose.foundation.background | ||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.gestures.detectDragGestures | ||
import androidx.compose.foundation.layout.offset | ||
import androidx.compose.runtime.MutableState | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.graphics.Color | ||
import androidx.compose.ui.input.pointer.changedToUp | ||
import androidx.compose.ui.input.pointer.pointerInput | ||
import androidx.compose.ui.unit.Density | ||
import androidx.compose.ui.unit.dp | ||
|
||
interface Draggable { | ||
fun Modifier.makeDraggable( | ||
density: Density, | ||
x: MutableState<Float>, | ||
y: MutableState<Float>, | ||
): Modifier = | ||
this.offset( | ||
(x.value / density.density).dp, | ||
(y.value / density.density).dp | ||
).pointerInput(Unit) { | ||
detectDragGestures { change, dragAmount -> | ||
change.consume() | ||
x.value += dragAmount.x | ||
y.value += dragAmount.y | ||
} | ||
|
||
}.clickable { | ||
this.background(Color.LightGray) | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
code/cat_visual/src/main/kotlin/canvas/items/impl/AbstractItem.kt
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 @@ | ||
package canvas.items.impl | ||
|
||
import androidx.compose.foundation.clickable | ||
import androidx.compose.foundation.layout.* | ||
import androidx.compose.runtime.Composable | ||
import androidx.compose.ui.Modifier | ||
import androidx.compose.ui.unit.dp | ||
import canvas.items.interfaces.CanvasItemInterface | ||
import canvas.items.model.Input | ||
import canvas.items.model.JsonCanvasModel | ||
import canvas.items.model.Output | ||
import connection.AbstractClient | ||
import kotlinx.serialization.Serializable | ||
import serializer.SerializationUtils | ||
import java.util.UUID | ||
|
||
open class AbstractItem( | ||
override val id: UUID = UUID.randomUUID(), | ||
override var x: Float, | ||
override var y: Float, | ||
override val inputs: List<Input> = listOf(), | ||
override val outputs: List<Output> = listOf(), | ||
protected open val modifier: Modifier = Modifier, | ||
protected open val content: Any? = null, | ||
protected open val client: AbstractClient? = null, | ||
): CanvasItemInterface { | ||
|
||
override val type: CanvasItemInterface.Type | ||
get() = CanvasItemInterface.Type.UNKNOWN | ||
|
||
override fun toModel(): JsonCanvasModel = | ||
JsonCanvasModel( | ||
id = id.toString(), | ||
x = x, | ||
y = y, | ||
inputs = inputs, | ||
outputs = outputs, | ||
type = type.toString(), | ||
content = content.toString(), | ||
) | ||
|
||
@Composable | ||
override fun getContent(deleteCurrentItem: (String) -> Unit) { | ||
Box(modifier = modifier | ||
.wrapContentSize()) | ||
} | ||
} |
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
Oops, something went wrong.