mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-03-22 15:10:43 +07:00
[pycharm] PY-79581 Debugger: add more initial stats
(cherry picked from commit 5088d74e290d9c7300528ec98692bab00f8d481d) GitOrigin-RevId: 970e04d408acd9357f5898db11ab38e60b780b2d
This commit is contained in:
committed by
intellij-monorepo-bot
parent
3a1b0ddb5b
commit
43982c2298
@@ -46,5 +46,6 @@
|
||||
<orderEntry type="module" module-name="intellij.xml.parser" />
|
||||
<orderEntry type="module" module-name="intellij.platform.ui.jcef" />
|
||||
<orderEntry type="library" name="kotlin-stdlib" level="project" />
|
||||
<orderEntry type="module" module-name="intellij.platform.statistics" />
|
||||
</component>
|
||||
</module>
|
||||
@@ -50,6 +50,7 @@
|
||||
description="Show action for changing background in the editor toolbar"/>
|
||||
<registryKey key="ide.images.sci.mode.channels.operations" defaultValue="true"
|
||||
description="Show combobox for image channels operations"/>
|
||||
<statistics.counterUsagesCollector implementationClass="org.intellij.images.scientific.statistics.ScientificImageActionsCollector"/>
|
||||
</extensions>
|
||||
|
||||
<actions>
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.intellij.openapi.actionSystem.CommonDataKeys
|
||||
import com.intellij.openapi.actionSystem.PlatformDataKeys
|
||||
import com.intellij.openapi.project.DumbAwareAction
|
||||
import org.intellij.images.scientific.ScientificUtils
|
||||
import org.intellij.images.scientific.statistics.ScientificImageActionsCollector
|
||||
|
||||
class CopyImageAction : DumbAwareAction() {
|
||||
override fun actionPerformed(e: AnActionEvent) {
|
||||
@@ -16,6 +17,7 @@ class CopyImageAction : DumbAwareAction() {
|
||||
return
|
||||
}
|
||||
provider.performCopy(dataContext)
|
||||
ScientificImageActionsCollector.logCopyImageAction(this)
|
||||
}
|
||||
|
||||
override fun update(e: AnActionEvent) {
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.intellij.openapi.vfs.writeBytes
|
||||
import org.intellij.images.editor.ImageDocument.IMAGE_DOCUMENT_DATA_KEY
|
||||
import org.intellij.images.scientific.ScientificUtils.DEFAULT_IMAGE_FORMAT
|
||||
import org.intellij.images.scientific.ScientificUtils.ORIGINAL_IMAGE_KEY
|
||||
import org.intellij.images.scientific.statistics.ScientificImageActionsCollector
|
||||
import java.awt.image.BufferedImage
|
||||
import java.io.ByteArrayOutputStream
|
||||
import javax.imageio.ImageIO
|
||||
@@ -25,6 +26,7 @@ class GrayscaleImageAction : DumbAwareAction() {
|
||||
imageFile.writeBytes(byteArrayOutputStream.toByteArray())
|
||||
val document = e.getData(IMAGE_DOCUMENT_DATA_KEY) ?: return
|
||||
document.value = grayscaleImage
|
||||
ScientificImageActionsCollector.logGrayscaleImageAction(this)
|
||||
}
|
||||
|
||||
private fun applyGrayscale(image: BufferedImage): BufferedImage {
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.intellij.openapi.vfs.writeBytes
|
||||
import org.intellij.images.editor.ImageDocument.IMAGE_DOCUMENT_DATA_KEY
|
||||
import org.intellij.images.scientific.ScientificUtils.DEFAULT_IMAGE_FORMAT
|
||||
import org.intellij.images.scientific.ScientificUtils.ORIGINAL_IMAGE_KEY
|
||||
import org.intellij.images.scientific.statistics.ScientificImageActionsCollector
|
||||
import java.awt.image.BufferedImage
|
||||
import java.io.ByteArrayOutputStream
|
||||
import javax.imageio.ImageIO
|
||||
@@ -25,6 +26,7 @@ class InvertChannelsAction : DumbAwareAction() {
|
||||
imageFile.writeBytes(byteArrayOutputStream.toByteArray())
|
||||
val document = e.getData(IMAGE_DOCUMENT_DATA_KEY) ?: return
|
||||
document.value = invertedImage
|
||||
ScientificImageActionsCollector.logInvertChannelsAction(this)
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -9,6 +9,7 @@ import com.intellij.openapi.vfs.writeBytes
|
||||
import org.intellij.images.editor.ImageDocument.IMAGE_DOCUMENT_DATA_KEY
|
||||
import org.intellij.images.scientific.ScientificUtils.DEFAULT_IMAGE_FORMAT
|
||||
import org.intellij.images.scientific.ScientificUtils.ORIGINAL_IMAGE_KEY
|
||||
import org.intellij.images.scientific.statistics.ScientificImageActionsCollector
|
||||
import java.io.ByteArrayOutputStream
|
||||
import javax.imageio.ImageIO
|
||||
|
||||
@@ -23,5 +24,6 @@ class RestoreOriginalImageAction : DumbAwareAction() {
|
||||
imageFile.writeBytes(byteArrayOutputStream.toByteArray())
|
||||
val document = e.getData(IMAGE_DOCUMENT_DATA_KEY) ?: return
|
||||
document.value = originalImage
|
||||
ScientificImageActionsCollector.logRestoreOriginalImageAction(this)
|
||||
}
|
||||
}
|
||||
@@ -11,6 +11,7 @@ import com.intellij.openapi.project.DumbAwareAction
|
||||
import com.intellij.openapi.vfs.VirtualFileManager
|
||||
import org.intellij.images.ImagesBundle
|
||||
import org.intellij.images.scientific.ScientificUtils
|
||||
import org.intellij.images.scientific.statistics.ScientificImageActionsCollector
|
||||
import java.io.IOException
|
||||
import java.nio.file.Files
|
||||
|
||||
@@ -36,6 +37,7 @@ internal class SaveImageAction : DumbAwareAction() {
|
||||
catch (e: IOException) {
|
||||
logger.warn("Failed to save image", e)
|
||||
}
|
||||
ScientificImageActionsCollector.logSaveImageAction(this)
|
||||
}
|
||||
|
||||
override fun update(e: AnActionEvent) {
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
package org.intellij.images.scientific.statistics
|
||||
|
||||
import com.intellij.internal.statistic.eventLog.EventLogGroup
|
||||
import com.intellij.internal.statistic.eventLog.events.EventFields
|
||||
import com.intellij.internal.statistic.service.fus.collectors.CounterUsagesCollector
|
||||
import org.intellij.images.scientific.action.*
|
||||
|
||||
object ScientificImageActionsCollector : CounterUsagesCollector() {
|
||||
private val GROUP = EventLogGroup("scientific.image.actions", 1)
|
||||
|
||||
private val copyImageAction = GROUP.registerEvent("copy_image_action", EventFields.Class("action_handler"))
|
||||
private val saveImageAction = GROUP.registerEvent("save_image_action", EventFields.Class("action_handler"))
|
||||
private val restoreOriginalImageAction = GROUP.registerEvent("restore_original_image_action", EventFields.Class("action_handler"))
|
||||
private val invertChannelsAction = GROUP.registerEvent("invert_channels_action", EventFields.Class("action_handler"))
|
||||
private val grayscaleImageAction = GROUP.registerEvent("grayscale_image_action", EventFields.Class("action_handler"))
|
||||
|
||||
override fun getGroup(): EventLogGroup = GROUP
|
||||
|
||||
fun logCopyImageAction(action: CopyImageAction) {
|
||||
copyImageAction.log(action::class.java)
|
||||
}
|
||||
|
||||
internal fun logSaveImageAction(action: SaveImageAction) {
|
||||
saveImageAction.log(action::class.java)
|
||||
}
|
||||
|
||||
fun logRestoreOriginalImageAction(action: RestoreOriginalImageAction) {
|
||||
restoreOriginalImageAction.log(action::class.java)
|
||||
}
|
||||
|
||||
fun logInvertChannelsAction(action: InvertChannelsAction) {
|
||||
invertChannelsAction.log(action::class.java)
|
||||
}
|
||||
|
||||
fun logGrayscaleImageAction(action: GrayscaleImageAction) {
|
||||
grayscaleImageAction.log(action::class.java)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user