<commit_before>package com.aljoschability.eclipse.stodito.ui.patterns;

import com.aljoschability.eclipse.core.graphiti.patterns.CorePattern
import com.aljoschability.eclipse.core.graphiti.util.GraphitiExtensions
import com.aljoschability.eclipse.stodito.StoditoPackage
import com.aljoschability.eclipse.stodito.StoryNode
import org.eclipse.emf.ecore.EObject
import org.eclipse.graphiti.features.context.IAddContext
import org.eclipse.graphiti.features.context.IDirectEditingContext
import org.eclipse.graphiti.func.IDirectEditing
import org.eclipse.graphiti.services.Graphiti
import org.eclipse.graphiti.util.IColorConstant
import com.aljoschability.eclipse.core.graphiti.services.AddService

class StoryNodeExtensions {
	def String getSymbol() {
		return StoditoPackage.Literals::STORY_NODE.name
	}
}

class StoryNodePattern extends CorePattern {
	extension GraphitiExtensions = GraphitiExtensions::INSTANCE
	extension StoryNodeExtensions = new StoryNodeExtensions
	extension AddService = AddService::INSTANCE

	override add(IAddContext context) {
		val nameFont = manageFont("Segoe UI", 10, false, true)

		return context.container.addContainerShape [
			link = context.newObject
			val frame = newRoundedRectangle[
				background = IColorConstant::WHITE
				foreground = IColorConstant::BLACK
				radius = 16
				position = context.position
				size = context.size(200, 100)
				val titleSymbol = newImage[
					name = "title.symbol"
					id = symbol
					position = #[7, 7]
					size = #[16, 16]
				]
				val titleText = newText[
					name = "title.text"
					position = #[27, 5]
					width = parentGraphicsAlgorithm.width - 54
					foreground = IColorConstant::BLACK
					height = 20
					font = nameFont
					value = "Test Calibri Font"
				]
				val titleSeparator = newPolyline[
					name = "title.separator"
					newPoint(0, 29)
					newPoint(parentGraphicsAlgorithm.width, 29)
				]
			]
			val contents = it.addContainerShape [
				name = "contents"
				active = false
				val contentsRectangle = newRectangle[
					position = #[5, 34]
					width = context.size(200, 100).get(0) - 10
					height = context.size(200, 100).get(1) - 39
				]
			]<commit_msg>adaptions to renamed service methods<commit_after>package com.aljoschability.eclipse.stodito.ui.patterns;

import com.aljoschability.eclipse.core.graphiti.patterns.CorePattern
import com.aljoschability.eclipse.core.graphiti.util.GraphitiExtensions
import com.aljoschability.eclipse.stodito.StoditoPackage
import com.aljoschability.eclipse.stodito.StoryNode
import org.eclipse.emf.ecore.EObject
import org.eclipse.graphiti.features.context.IAddContext
import org.eclipse.graphiti.features.context.IDirectEditingContext
import org.eclipse.graphiti.func.IDirectEditing
import org.eclipse.graphiti.services.Graphiti
import org.eclipse.graphiti.util.IColorConstant
import com.aljoschability.eclipse.core.graphiti.services.AddService

class StoryNodeExtensions {
	def String getSymbol() {
		return StoditoPackage.Literals::STORY_NODE.name
	}
}

class StoryNodePattern extends CorePattern {
	extension GraphitiExtensions = GraphitiExtensions::INSTANCE
	extension StoryNodeExtensions = new StoryNodeExtensions
	extension AddService = AddService::INSTANCE

	override add(IAddContext context) {
		val nameFont = manageFont("Segoe UI", 10, false, true)

		return context.container.addContainerShape [
			link = context.newObject
			val frame = addRoundedRectangle[
				background = IColorConstant::WHITE
				foreground = IColorConstant::BLACK
				radius = 16
				position = context.position
				size = context.size(200, 100)
				val titleSymbol = addImage(symbol) [
					position = #[7, 7]
					size = #[16, 16]
				]
				val titleText = addText[
					name = "title.text"
					position = #[27, 5]
					width = parentGraphicsAlgorithm.width - 54
					foreground = IColorConstant::BLACK
					height = 20
					font = nameFont
					value = "Test Calibri Font"
				]
				val titleSeparator = addPolyline[
					name = "title.separator"
					addPoint(0, 29)
					addPoint(parentGraphicsAlgorithm.width, 29)
				]
			]
			val contents = it.addContainerShape [
				name = "contents"
				active = false
				val contentsRectangle = addRectangle[
					position = #[5, 34]
					width = context.size(200, 100).get(0) - 10
					height = context.size(200, 100).get(1) - 39
				]
			]
{'fraction_non_alphanumeric': 0.09227567067530065, 'fraction_numerical': 0.022664199814986123, 'mean_word_length': 3.9769850402761797, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '989657', 'n_tokens_mistral': 1629, 'n_tokens_neox': 1309, 'n_words': 274}