Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ plugins {
}

group = 'com.josdem.jmetadata'
version = '1.3.5'
version = '1.3.6'

java {
toolchain {
Expand Down
11 changes: 1 addition & 10 deletions src/main/java/com/josdem/jmetadata/dnd/DragTooltipDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,8 @@ public boolean matches(Object o) {
private boolean allowed;

public DragTooltipDialog(Window owner) {
super(
(owner instanceof Frame) ? (JFrame) owner : null,
null,
false,
TransparencyManagerFactory.getManager().getTranslucencyCapableGC());
super((owner instanceof Frame) ? (JFrame) owner : null, null, false);
initialize();
TransparencyManagerFactory.getManager().setWindowOpaque(this, false);
}

private void initialize() {
Expand Down Expand Up @@ -144,7 +139,6 @@ public void setAllowed(boolean allowed) {
log.debug("Drag tootltip display error.");
}
}
TransparencyManagerFactory.getManager().setWindowOpaque(this, false);
}

private void setFullSize(Dimension contentSize) {
Expand Down Expand Up @@ -174,7 +168,6 @@ public void setContent(FileSystemValidatorLight validator) {
int width = 0;
Dimension contentSize = new Dimension(width, height);
this.setFullSize(contentSize);
TransparencyManagerFactory.getManager().setWindowOpaque(this, false);
}

public void setContent(String... message) {
Expand All @@ -200,7 +193,6 @@ protected void paintComponent(Graphics g) {
descriptionPanel.setBounds(7, 20, width, height);
descriptionPanel.add(imagePanel);
this.setFullSize(width + 14, height + dragIcon.getHeight() + 7);
TransparencyManagerFactory.getManager().setWindowOpaque(this, false);
}

private Dimension fillContent(List<?>... stuff) {
Expand All @@ -216,7 +208,6 @@ private Dimension fillContent(List<?>... stuff) {
descriptionPanel.setBounds(21, 3, width, height);
descriptionPanel.add(dynamicPanel.getPanel());
}
TransparencyManagerFactory.getManager().setWindowOpaque(this, false);
return new Dimension(width, height);
}

Expand Down
138 changes: 0 additions & 138 deletions src/main/java/com/josdem/jmetadata/dnd/Jdk6u10TransparencyManager.java

This file was deleted.

This file was deleted.

35 changes: 0 additions & 35 deletions src/main/java/com/josdem/jmetadata/dnd/TransparencyManager.java

This file was deleted.

This file was deleted.

37 changes: 18 additions & 19 deletions src/test/java/com/josdem/jmetadata/util/ImageIconBaseTests.java
Original file line number Diff line number Diff line change
@@ -1,36 +1,35 @@
package com.josdem.jmetadata.util;

import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;

import javax.swing.ImageIcon;

import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;

class ImageIconBaseTests {

private static ImageIconBase imageIconBase;
private static ImageIconBase imageIconBase;

@BeforeAll
static void init() {
imageIconBase = mock(ImageIconBase.class);
}
@BeforeAll
static void init() {
imageIconBase = mock(ImageIconBase.class);
}

@Test
void testGetImageIcon() {
// Given
String imagePath = "path/to/image.png";
var expectedImageIcon = new ImageIcon(imagePath);
when(imageIconBase.getImageIcon()).thenReturn(expectedImageIcon);
@Test
void testGetImageIcon() {
// Given
String imagePath = "path/to/image.png";
var expectedImageIcon = new ImageIcon(imagePath);
when(imageIconBase.getImageIcon()).thenReturn(expectedImageIcon);

// When
ImageIcon result = imageIconBase.getImageIcon();
// When
ImageIcon result = imageIconBase.getImageIcon();

// Then
assertNotNull(result);
assertEquals(expectedImageIcon.getDescription(), result.getDescription());
}
// Then
assertNotNull(result);
assertEquals(expectedImageIcon.getDescription(), result.getDescription());
}
}